/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * TelaFinEntradas.java
 *
 * Created on 06/06/2011, 19:34:32
 */
package asfabdesk.apresentacao;

import asfabdesk.dominio.Associado;
import asfabdesk.dominio.CentroDeCusto;
import asfabdesk.dominio.Convenio;
import asfabdesk.dominio.ConvenioPorAssociado;
import asfabdesk.dominio.ConvenioPorDependente;
import asfabdesk.dominio.Data;
import asfabdesk.dominio.DataUtil;
import asfabdesk.dominio.Dependente;
import asfabdesk.dominio.DepositoFinanceiro;
import asfabdesk.dominio.EntradaFinanceira;
import asfabdesk.dominio.HistoricoFinanceiro;
import asfabdesk.dominio.InadimplenciaContribuicao;
import asfabdesk.dominio.InadimplenciaConvenio;
import asfabdesk.dominio.ItemEntrada;
import asfabdesk.dominio.ItemSaida;
import asfabdesk.dominio.Moeda;
import asfabdesk.dominio.SaidaFinanceira;
import asfabdesk.dominio.TipoEntrada;
import asfabdesk.dominio.TipoSaida;
import asfabdesk.dominio.Usuario;
import asfabdesk.presistencia.DAO;
import asfabdesk.util.RelatorioUtil;
import java.net.URL;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ButtonGroup;
import javax.swing.JInternalFrame;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import org.joda.time.DateTime;

/**
 *
 * @author Marco Aurelio
 */
public class TelaFinanceiro extends javax.swing.JInternalFrame {

    private DepositoFinanceiro depositoEntradas = new DepositoFinanceiro();
    private TipoEntrada tipoEntrada = new TipoEntrada();
    private Convenio convenio = new Convenio();
    private DepositoFinanceiro depositoSaida = new DepositoFinanceiro();
    private TipoSaida tipoSaida = new TipoSaida();
    private CentroDeCusto centroCusto = new CentroDeCusto();
    private Date dataInicioEnt = new Date();
    private Date dataFimEnt = new Date();
    private Date dataInicioSaida = new Date();
    private Date dataFimSaida = new Date();
    private Date dataInicioExtrato = new Date();
    private Date dataFimExtrato = new Date();
    private int situacaoEnt;
    private Date competencia;
    private List<EntradaFinanceira> entradas = new ArrayList<EntradaFinanceira>();
    private List<SaidaFinanceira> saidas = new ArrayList<SaidaFinanceira>();
    private int situacaoSaida;
    private double valorTotalEntradas;
    private double valorTotalSaidas;
    private double saldoAtualExtrato;
    private DepositoFinanceiro depositoExtrato = new DepositoFinanceiro();
    private List<HistoricoFinanceiro> extrato = new ArrayList<HistoricoFinanceiro>();
    ButtonGroup grupoRadioConv1 = new ButtonGroup();
    ButtonGroup grupoRadioConv2 = new ButtonGroup();
    ButtonGroup grupoRadioCont1 = new ButtonGroup();
    ButtonGroup grupoRadioCont2 = new ButtonGroup();
    String relatorioEntradas = "";
    private boolean convAdimple = true;
    private List<Associado> associadosContInadimple = new ArrayList<Associado>();
    private List<ItemEntrada> associadosContAdimple = new ArrayList<ItemEntrada>();
    private Usuario usuario = TelaLogin.usuario;

    /** Creates new form TelaFinEntradas */
    public TelaFinanceiro() throws SQLException {
        initComponents();
        configurarTela();
    }

    public void configurarTela() throws SQLException {
        configurarAcesso();
        configurarComboDepositoEntrada();
        configurarComboDepositoExtrato();
        configurarComboDepositoSaida();
        configurarComboConvenioConv();

        DateTime hoje = new DateTime();
        txtFimEnt.setText(hoje.toString("dd/MM/yyyy"));
        txtFimSaida.setText(hoje.toString("dd/MM/yyyy"));
        txtFimExt.setText(hoje.toString("dd/MM/yyyy"));

        hoje = DataUtil.getPrimeiroDiaMes();
        txtInicioEnt.setText(hoje.toString("dd/MM/yyyy"));
        txtInicioSaida.setText(hoje.toString("dd/MM/yyyy"));
        txtInicioExt.setText(hoje.toString("dd/MM/yyyy"));

        grupoRadioConv1.add(radioAdimplentesConv);
        grupoRadioConv1.add(radioInadimplentesConv);
        grupoRadioCont1.add(radioAdimplentesCont);
        grupoRadioCont1.add(radioInadimplentesCont);
    }

    public void configurarAcesso(){
        //entradas
        btnFiltrarEntradas.setEnabled(usuario.getNivelAcesso().isFiltrarEntradas());
        btnNovaEntrada.setEnabled(usuario.getNivelAcesso().isNovaEntrada());
        btnImprimirEntrada.setEnabled(usuario.getNivelAcesso().isImprimirEntradas());
        //saidas
        btnFiltrarSaidas.setEnabled(usuario.getNivelAcesso().isFiltrarSaidas());
        btnNovaSaida.setEnabled(usuario.getNivelAcesso().isNovaSaida());
        btnImprimirSaida.setEnabled(usuario.getNivelAcesso().isImprimirSaidas());
        //extrato
        btnFiltrarExt.setEnabled(usuario.getNivelAcesso().isFiltrarExtrato());
        btnImprimirExt.setEnabled(usuario.getNivelAcesso().isImprimirExtrato());
        //convenio
        btnFiltraConvenios.setEnabled(usuario.getNivelAcesso().isFiltrarConvenios());
        //contribuicao
        btnFiltrarContribuicoes.setEnabled(usuario.getNivelAcesso().isFiltrarContribuicoes());
    }

    //########################################### CÓDIGOS DA ABA DE ENTRADA ###############################################################################
    public final void configurarComboDepositoEntrada() throws SQLException {
        comboDepEnt.addItem("");
        comboDepEnt.setSelectedItem("");
        java.util.List depositos = (new DAO()).listar(DepositoFinanceiro.class);
        for (int i = 0; i < depositos.size(); i++) {
            String descricao = ((DepositoFinanceiro) depositos.get(i)).getDescricao();
            comboDepEnt.addItem(descricao);
        }
    }

    public void configurarComboTipoEntrada() throws SQLException {
        comboTipoEnt.removeAllItems();
        java.util.List tipos = (new DAO()).listar(TipoEntrada.class);
        for (int i = 0; i < tipos.size(); i++) {
            String descricao = ((TipoEntrada) tipos.get(i)).getDescricao();
            comboTipoEnt.addItem(descricao);
        }
        comboTipoEnt.addItem("");
        comboTipoEnt.setSelectedItem("");
    }

    public void configurarComboTipoEntrada(DepositoFinanceiro deposito) throws SQLException {
        comboTipoEnt.removeAllItems();
        comboTipoEnt.addItem("");
        comboTipoEnt.setSelectedItem("");
        java.util.List tipos = (new DAO()).listar(TipoEntrada.class, "TipoEntradaPorDeposito", deposito);
        for (int i = 0; i < tipos.size(); i++) {
            String descricao = ((TipoEntrada) tipos.get(i)).getDescricao();
            comboTipoEnt.addItem(descricao);
        }

    }

    public void configurarComboConvenio() throws SQLException {
        comboConv.removeAllItems();
        comboConv.addItem("");
        comboConv.setSelectedItem("");
        java.util.List centros = (new DAO()).listar(Convenio.class);
        for (int i = 0; i < centros.size(); i++) {
            String descricao = ((Convenio) centros.get(i)).getNome();
            comboConv.addItem(descricao);
        }
    }

    public void acaoComboDeposito() throws SQLException {
        if (comboDepEnt.getSelectedItem().equals("")) {
            comboTipoEnt.removeAllItems();
        } else {
            DepositoFinanceiro deposit = new DAO().localizar(DepositoFinanceiro.class, "depositoPorNome", comboDepEnt.getSelectedItem().toString());
            try {
                configurarComboTipoEntrada(deposit);
            } catch (SQLException ex) {
                Logger.getLogger(TelaFinanceiro.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }

    public void acaoComboTipoEntrada() throws SQLException {
        if (comboTipoEnt.getSelectedItem().equals("")) {
            comboConv.removeAllItems();
            System.out.println("Tipo Entrada vazio ##############################");
        } else {
            TipoEntrada tipo = new DAO().localizar(TipoEntrada.class, "TipoEntradaPorNome", comboTipoEnt.getSelectedItem().toString());
            if (tipo.getNatureza() == 1) {
                configurarComboConvenio();
                System.out.println("Tipo Entrada Convênio ##############################");
            } else {
                comboConv.removeAllItems();
                System.out.println("Tipo Entrada NÂO Convênio ##############################");
            }
        }
    }

    public void filtrarEntradas() throws ParseException {
        setarFiltrosEntradas();
        selecionarFiltroEntradas();
    }

    public void setarFiltrosEntradas() throws ParseException {
        DAO dao = new DAO();
        int ano = 0, comp = 0;
        try {
            ano = Integer.valueOf(comboAnoEnt.getSelectedItem().toString());
            comp = Integer.valueOf(comboComptEnt.getSelectedItem().toString());
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        if (comboDepEnt.getSelectedItem() == null) {
            depositoEntradas = null;
            tipoEntrada = null;
            convenio = null;
        } else {
            depositoEntradas = dao.localizar(DepositoFinanceiro.class, "depositoPorNome", comboDepEnt.getSelectedItem().toString());
            if (comboTipoEnt.getSelectedItem() != null) {
                tipoEntrada = dao.localizar(TipoEntrada.class, "TipoEntradaPorNome", comboTipoEnt.getSelectedItem().toString());
            }
            if (comboConv.getSelectedItem() != null) {
                convenio = dao.localizar(Convenio.class, "ConvenioPorNome", comboConv.getSelectedItem().toString());
            }
        }
        if (comboSitEnt.getSelectedIndex() == 0) {
            situacaoEnt = 2; // confirmada
        } else if (comboSitEnt.getSelectedIndex() == 1) {
            situacaoEnt = 1; // lançada
        } else if (comboSitEnt.getSelectedIndex() == 2) {
            situacaoEnt = 4; // confirmada / lançada
        } else if (comboSitEnt.getSelectedIndex() == 3) {
            situacaoEnt = 3; // cancelada
        }
        dataInicioEnt = new Data().ConverteDataHoraStringDate(txtInicioEnt.getText());
        dataFimEnt = new Data().ConverteDataHoraStringDate(txtFimEnt.getText());
        if (comboComptEnt.getSelectedIndex() > 0 && comboAnoEnt.getSelectedIndex() > 0) {
            competencia = new Data().ConverteDataStringDate("01" + "/" + comp + "/" + ano);
        } else {
            competencia = null;
        }

        System.out.println("TESTANDO OS FILTROS :");
//        System.out.println("Deposito E:" + depositoEntradas.getDescricao());
//        System.out.println("Tipo Entrada:" + tipoEntrada.getDescricao());
//        System.out.println("Convenio:" + convenio.getNome());
        System.out.println("Situação:" + situacaoEnt);
        System.out.println("Inicio:" + dataInicioEnt);
        System.out.println("Fim:" + dataFimEnt);
        System.out.println("Competencia:" + competencia);
    }

    public boolean verificarCompetenciaAno() {
        boolean resultado = true;
        if (competencia == null) {
            resultado = false;
        } else if (competencia != null) {
            resultado = true;
        }
        if (resultado == false) {
            JOptionPane.showMessageDialog(null, "Para filtrar por competências é preciso selecionar os campos Competência e Ano!", "ops", 2);
        }
        return resultado;
    }

    public void selecionarFiltroEntradas() {
        if (depositoEntradas == null && competencia == null) {
            entradasPorSituacao(dataInicioEnt, dataFimEnt, situacaoEnt);
        } else if (depositoEntradas != null && competencia == null && tipoEntrada == null) {
            entradasPorSituacaoDeposito(dataInicioEnt, dataFimEnt, situacaoEnt, depositoEntradas);
        } else if (tipoEntrada != null && competencia == null) {
            entradasPorSituacaoTipoEntrada(dataInicioEnt, dataFimEnt, situacaoEnt, tipoEntrada);
        } else if (convenio != null && competencia == null) {
            entradasPorSituacaoConvenio(dataInicioEnt, dataFimEnt, situacaoEnt, convenio);
        } else if (depositoEntradas == null && competencia != null) {
            if (verificarCompetenciaAno()) {
                entradasPorSituacaoCompetencia(dataInicioEnt, dataFimEnt, situacaoEnt, competencia);
            }
        } else if (depositoEntradas != null && competencia != null && tipoEntrada == null) {
            if (verificarCompetenciaAno()) {
                entradasPorSituacaoDepositoCompetencia(dataInicioEnt, dataFimEnt, situacaoEnt, depositoEntradas, competencia);
            }
        } else if (tipoEntrada != null && competencia != null && convenio == null) {
            if (verificarCompetenciaAno()) {
                entradasPorSituacaoTipoEntradaCompetencia(dataInicioEnt, dataFimEnt, situacaoEnt, tipoEntrada, competencia);
            }
        } else if (convenio != null && competencia != null) {
            if (verificarCompetenciaAno()) {
                entradasPorSituacaoConvenioCompetencia(dataInicioEnt, dataFimEnt, situacaoEnt, convenio, competencia);
            }
        }
    }

    // LISTAGENS POR SITUAÇÃO //////////////////////////////////////////////////////////////////////////////
    public void entradasPorSituacao(Date data1, Date data2, int situacao) {
        if (situacao == 4) {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoAmbas", data1, data2);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoAmbas");
        } else {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacao", data1, data2, situacao);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacao");
        }
    }

    public void entradasPorSituacaoDeposito(Date data1, Date data2, int situacao, DepositoFinanceiro deposito) {
        if (situacao == 4) {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoAmbasDeposito", data1, data2, deposito);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoAmbasDeposito");
        } else {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoDeposito", data1, data2, situacao, deposito);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoDeposito");
        }
    }

    public void entradasPorSituacaoTipoEntrada(Date data1, Date data2, int situacao, TipoEntrada tipo) {
        if (situacao == 4) {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoAmbasTipoEntrada", data1, data2, tipo);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoAmbasTipoEntrada");
        } else {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoTipoEntrada", data1, data2, situacao, tipo);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoTipoEntrada");
        }
    }

    public void entradasPorSituacaoConvenio(Date data1, Date data2, int situacao, Convenio conv) {
        if (situacao == 4) {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoAmbasConvenio", data1, data2, conv);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoAmbasConvenio");
        } else {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoConvenio", data1, data2, situacao, conv);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoConvenio");
        }
    }

    // LISTAGENS POR SITUAÇÃO COMPETÊNCIA E ANO /////////////////////////////////////////////////////////////////
    public void entradasPorSituacaoCompetencia(Date data1, Date data2, int situacao, Date comp) {
        if (situacao == 4) {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoAmbasCompetencia", data1, data2, comp);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoAmbasCompetencia");
        } else {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoCompetencia", data1, data2, situacao, comp);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoCompetencia");
        }
    }

    public void entradasPorSituacaoDepositoCompetencia(Date data1, Date data2, int situacao, DepositoFinanceiro deposito, Date comp) {
        if (situacao == 4) {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoAmbasDepositoCompetencia", data1, data2, deposito, comp);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoAmbasDepositoCompetencia");
        } else {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoDepositoCompetencia", data1, data2, situacao, deposito, comp);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoDepositoCompetencia");
        }
    }

    public void entradasPorSituacaoTipoEntradaCompetencia(Date data1, Date data2, int situacao, TipoEntrada tipo, Date comp) {
        if (situacao == 4) {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoAmbasTipoEntradaCompetencia", data1, data2, tipo, comp);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoAmbasTipoEntradaCompetencia");
        } else {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoTipoEntradaCompetencia", data1, data2, situacao, tipo, comp);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoTipoEntradaCompetencia");
        }
    }

    public void entradasPorSituacaoConvenioCompetencia(Date data1, Date data2, int situacao, Convenio conv, Date comp) {
        if (situacao == 4) {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoAmbasConvenioCompetencia", data1, data2, conv, comp);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoAmbasConvenioCompetencia");
        } else {
            entradas = new DAO().listar(EntradaFinanceira.class, "EntradasPorSituacaoConvenioCompetencia", data1, data2, situacao, conv, comp);
            atualizarTabelaEntrada(entradas);
            System.out.println("EntradasPorSituacaoConvenioCompetencia");
        }
    }

    public void atualizarTabelaEntrada(List<EntradaFinanceira> entradas) {
        tabelaEntradas.setModel(new ModeloEntrada(entradas));
        double valorParcial = 0;
        for (int i = 0; i < entradas.size(); i++) {
            valorParcial = valorParcial + entradas.get(i).getValorTotal();
        }
        valorTotalEntradas = valorParcial;
        txtTotalEntrada.setText(new Moeda(valorTotalEntradas).toString());
    }

    public void abrirEntrada() throws SQLException {
        EntradaFinanceira entrada = (((ModeloEntrada) tabelaEntradas.getModel()).getEntrada(tabelaEntradas.getSelectedRow()));
        List<ItemEntrada> itens = new DAO().listar(ItemEntrada.class, "ItensPorEntrada", entrada);
        if (entrada != null) {
            abrirIFrame(new TelaFinEntrada(entrada, itens));
        }
    }

    private class ModeloEntrada extends DefaultTableModel {

        private List<EntradaFinanceira> lista;
        private String[] campos = new String[]{"Id", "N°", "Depósito", "Tipo", "CPT", "Ano", "Data", "Situação", "Valor R$"};

        public ModeloEntrada(List<EntradaFinanceira> list) {
            lista = list;
        }

        public ModeloEntrada() {
        }

        public EntradaFinanceira getEntrada(int index) {
            return lista.get(index);
        }

        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }

        @Override
        public Object getValueAt(int row, int column) {
            EntradaFinanceira ent = lista.get(row);

            switch (column) {
                case 0:
                    return row + 1;

                case 1:
                    return ent.getId().toString();

                case 2:
                    return ent.getTipoEntrada().getDepositoFinanceiro().getDescricao();

                case 3:
                    return ent.getTipoEntrada().getDescricao();

                case 4:
                    return DataUtil.escreverMes(ent.getCompetencia());

                case 5:
                    return DataUtil.toString(ent.getCompetencia(), "yyyy");

                case 6:
                    return new Data().ConverteDataDateStringBra(ent.getDataEntrada());

                case 7:
                    if (ent.getSituacao() == 1) {
                        return "Lançada";
                    } else if (ent.getSituacao() == 2) {
                        return "Confirmada";
                    } else if (ent.getSituacao() == 3) {
                        return "Cancelada";
                    }

                case 8:
                    return new Moeda(ent.getValorTotal()).toString();
                default:
                    return null;
            }
        }

        @Override
        public int getRowCount() {
            return lista == null ? 0 : lista.size();
        }

        @Override
        public int getColumnCount() {
            return campos.length;
        }

        @Override
        public String getColumnName(int column) {
            return campos[column];
        }
    }

//    "Id", "N°", "Depósito", "Tipo", "CPT", "Ano", "Data", "Situação", "Valor R$map"
    public void imprimirEntradas() {
        List<HashMap<String, String>> lista = new ArrayList();
        for (int e = 0; e < entradas.size(); e++) {
            HashMap<String, String> mapa = new HashMap();

            mapa.put("id", String.valueOf(e + 1));
            mapa.put("numero", String.valueOf(entradas.get(e).getId()));
            mapa.put("deposito", entradas.get(e).getTipoEntrada().getDepositoFinanceiro().getDescricao());
            mapa.put("tipoEntrada", entradas.get(e).getTipoEntrada().getDescricao());
            mapa.put("competencia", DataUtil.escreverMesNumerado(entradas.get(e).getCompetencia()));
            mapa.put("ano", DataUtil.toString(entradas.get(e).getCompetencia(), "yyyy"));
            mapa.put("data", DataUtil.toString(entradas.get(e).getDataEntrada(), "dd/MM/yyyy"));
            mapa.put("valor", new Moeda(entradas.get(e).getValorTotal()).toString());
            if (entradas.get(e).getSituacao() == 1) {
                mapa.put("situacao", "Lançada");
            } else if (entradas.get(e).getSituacao() == 2) {
                mapa.put("situacao", "Confirmada");
            } else if (entradas.get(e).getSituacao() == 3) {
                mapa.put("situacao", "Cancelada");
            }
            lista.add(mapa);
        }
        Map parametros = new HashMap();
        Class classpath = new RelatorioUtil().getClass();
        URL url = classpath.getResource("/asfabdesk/apresentacao/resources/busyicons/Logo-ASFAB-degrade.png");
        String img = url.toString();
        parametros.put("filtros", relatorioEntradas);
        parametros.put("img", img);
        parametros.put("usuario", TelaLogin.usuario.getNome());
        parametros.put("data1", DataUtil.toString(dataInicioEnt, "dd/MM/yyyy"));
        parametros.put("data2", DataUtil.toString(dataFimEnt, "dd/MM/yyyy"));
        parametros.put("valorTotal", new Moeda(valorTotalEntradas).imprimiComCifrao());
        try {
            parametros.put("competencia", String.valueOf(competencia));
        } catch (Exception e) {
        }
        try {
            parametros.put("ano", DataUtil.toString(competencia, "yyyy"));
        } catch (Exception e) {
        }
        try {
            parametros.put("deposito", depositoEntradas.getDescricao());
        } catch (Exception e) {
        }
        try {
            parametros.put("tipoEntrada", tipoEntrada.getDescricao());
        } catch (Exception e) {
        }
        try {
            parametros.put("convenio", convenio.getDescricao());
        } catch (Exception e) {
        }

        new RelatorioUtil().imprimir("Entradas", "Entradas", lista, parametros);
    }

    //########################################### CÓDIGOS DA ABA DE SAÍDA ###############################################################################
    //
    public void filtrarSaidas() throws ParseException {
        setarFiltrosSaidas();
        selecionarFiltroSaida();
    }

    public void setarFiltrosSaidas() throws ParseException {
        DAO dao = new DAO();
        if (comboDepositoSaida.getSelectedItem() == null) {
            depositoSaida = null;
            tipoSaida = null;
            centroCusto = null;
        } else {
            depositoSaida = dao.localizar(DepositoFinanceiro.class, "depositoPorNome", comboDepositoSaida.getSelectedItem().toString());
            if (comboTipoSaida.getSelectedItem() != null) {
                tipoSaida = dao.localizar(TipoSaida.class, "TipoSaidaPorNome", comboTipoSaida.getSelectedItem().toString());
            }
//            if (comboCentroCusto.getSelectedItem() != null) {
//                centroCusto = dao.localizar(CentroDeCusto.class, "CentroCustoPorNome", comboCentroCusto.getSelectedItem().toString());
//            }
        }
        if (comboSitSaida.getSelectedIndex() == 0) {
            situacaoSaida = 2; // confirmada
        } else if (comboSitSaida.getSelectedIndex() == 1) {
            situacaoSaida = 1; // lançada
        } else if (comboSitSaida.getSelectedIndex() == 2) {
            situacaoSaida = 4; // confirmada / lançada
        } else if (comboSitSaida.getSelectedIndex() == 3) {
            situacaoSaida = 3; // cancelada
        }
        dataInicioSaida = new Data().ConverteDataHoraStringDate(txtInicioSaida.getText());
        dataFimSaida = new Data().ConverteDataHoraStringDate(txtFimSaida.getText());
//        System.out.println("TESTANDO OS FILTROS :");
//        System.out.println("Deposito E:" + depositoEntradas.getDescricao());
//        System.out.println("Tipo Entrada:" + tipoEntrada.getDescricao());
//        System.out.println("Convenio:" + convenio.getNome());
//        System.out.println("Situação:" + situacaoEnt);
//        System.out.println("Inicio:" + dataInicioEnt);
//        System.out.println("Fim:" + dataFimEnt);
    }

    public void selecionarFiltroSaida() {
        if (depositoSaida == null) {
            saidasPorSituacao(dataInicioSaida, dataFimSaida, situacaoSaida);
        } else if (depositoSaida != null) {
            saidasPorSituacaoDeposito(dataInicioSaida, dataFimSaida, situacaoSaida, depositoSaida);
        } else if (tipoSaida != null) {
            saidasPorSituacaoTipoSaida(dataInicioEnt, dataFimEnt, situacaoEnt, tipoSaida);
        }
    }

    // LISTAGENS POR SITUAÇÃO //////////////////////////////////////////////////////////////////////////////
    public void saidasPorSituacao(Date data1, Date data2, int situacao) {
        if (situacao == 4) {
            saidas = new DAO().listar(SaidaFinanceira.class, "SaidasPorSituacaoAmbas", data1, data2);
            atualizarTabelaSaida(saidas);
        } else {
            saidas = new DAO().listar(SaidaFinanceira.class, "SaidasPorSituacao", data1, data2, situacao);
            atualizarTabelaSaida(saidas);
        }
    }

    public void saidasPorSituacaoDeposito(Date data1, Date data2, int situacao, DepositoFinanceiro deposito) {
        if (situacao == 4) {
            saidas = new DAO().listar(SaidaFinanceira.class, "SaidasPorSituacaoAmbasDeposito", data1, data2, deposito);
            atualizarTabelaSaida(saidas);
        } else {
            saidas = new DAO().listar(SaidaFinanceira.class, "SaidasPorSituacaoDeposito", data1, data2, situacao, deposito);
            atualizarTabelaSaida(saidas);
        }
    }

    public void saidasPorSituacaoTipoSaida(Date data1, Date data2, int situacao, TipoSaida tipo) {
        if (situacao == 4) {
            saidas = new DAO().listar(SaidaFinanceira.class, "SaidasPorSituacaoAmbasTipoSaida", data1, data2, tipo);
            atualizarTabelaSaida(saidas);
        } else {
            saidas = new DAO().listar(SaidaFinanceira.class, "SaidasPorSituacaoTipoSaida", data1, data2, situacao, tipo);
            atualizarTabelaSaida(saidas);
        }
    }

//    public void saidasPorSituacaoCentroCusto(Date data1, Date data2, int situacao, CentroDeCusto centro) {
//        if (situacao == 4) {
//            saidas = new DAO().listar(SaidaFinanceira.class, "SaidasPorSituacaoAmbasCenro", data1, data2, centro);
//            atualizarTabelaSaida(saidas);
//        } else {
//            saidas = new DAO().listar(SaidaFinanceira.class, "SaidasPorSituacaoCentro", data1, data2, situacao, centro);
//            atualizarTabelaSaida(saidas);
//        }
//    }
    public void atualizarTabelaSaida(List<SaidaFinanceira> saidas) {
        tabelaSaidas.setModel(new ModeloSaida(saidas));
        double valorParcial = 0;
        for (int i = 0; i < saidas.size(); i++) {
            valorParcial = valorParcial + saidas.get(i).getValorTotal();
        }
        valorTotalSaidas = valorParcial;
        txtTotalSaida.setText(new Moeda(valorTotalSaidas).toString());
    }

    public final void configurarComboDepositoSaida() throws SQLException {
        java.util.List depositos = (new DAO()).listar(DepositoFinanceiro.class);
        for (int i = 0; i < depositos.size(); i++) {
            String descricao = ((DepositoFinanceiro) depositos.get(i)).getDescricao();
            comboDepositoSaida.addItem(descricao);
        }
        comboDepositoSaida.addItem("");
        comboDepositoSaida.setSelectedItem("");
    }

    public void configurarComboTipoSaida() throws SQLException {
        comboTipoSaida.removeAllItems();
        java.util.List tipos = (new DAO()).listar(TipoSaida.class);
        for (int i = 0; i < tipos.size(); i++) {
            String descricao = ((TipoSaida) tipos.get(i)).getDescricao();
            comboTipoSaida.addItem(descricao);
        }
        comboTipoSaida.addItem("");
        comboTipoSaida.setSelectedItem("");
    }

    public void configurarComboTipoSaida(DepositoFinanceiro deposito) throws SQLException {
        comboSitSaida.removeAllItems();
        java.util.List tipos = (new DAO()).listar(TipoSaida.class, "TipoSaidaPorDeposito", deposito);
        for (int i = 0; i < tipos.size(); i++) {
            String descricao = ((TipoSaida) tipos.get(i)).getDescricao();
            comboTipoSaida.addItem(descricao);
        }
        comboTipoSaida.addItem("");
        comboTipoSaida.setSelectedItem("");
    }

//    public void configurarComboCentroCusto() throws SQLException {
//        comboCentroCusto.removeAllItems();
//        java.util.List centros = (new DAO()).listar(CentroDeCusto.class);
//        for (int i = 0; i < centros.size(); i++) {
//            String descricao = ((CentroDeCusto) centros.get(i)).getDescricao();
//            comboCentroCusto.addItem(descricao);
//        }
//        comboCentroCusto.addItem("");
//        comboCentroCusto.setSelectedItem("");
//    }
//
//    public void configurarComboCentroCusto(TipoSaida tipo) throws SQLException {
//        comboCentroCusto.removeAllItems();
//        java.util.List centros = (new DAO()).listar(CentroDeCusto.class, "CentroCustoPorTipoSaida2", tipo);
//        for (int i = 0; i < centros.size(); i++) {
//            String descricao = ((CentroDeCusto) centros.get(i)).getDescricao();
//            comboCentroCusto.addItem(descricao);
//        }
//        comboCentroCusto.addItem("");
//        comboCentroCusto.setSelectedItem("");
//    }
    public void abrirSaida() throws SQLException {
        SaidaFinanceira saida = (((ModeloSaida) tabelaSaidas.getModel()).getSaida(tabelaSaidas.getSelectedRow()));
        List<ItemSaida> itens = new DAO().listar(ItemSaida.class, "ItensPorSaida", saida);
        if (saida != null) {
            abrirIFrame(new TelaFinSaida(saida, itens));
        }
    }

    private class ModeloSaida extends DefaultTableModel {

        private List<SaidaFinanceira> lista;
        private String[] campos = new String[]{"Id", "N°", "Depósito", "Tipo saída", "Data", "Situação", "Valor R$"};

        public ModeloSaida(List<SaidaFinanceira> list) {
            lista = list;
        }

        public ModeloSaida() {
        }

        public SaidaFinanceira getSaida(int index) {
            return lista.get(index);
        }

        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }

        @Override
        public Object getValueAt(int row, int column) {
            SaidaFinanceira said = lista.get(row);

            switch (column) {
                case 0:
                    return row + 1;

                case 1:
                    return said.getId().toString();

                case 2:
                    return said.getTipoSaida().getDepositoFinanceiro().getDescricao();

                case 3:
                    return said.getTipoSaida().getDescricao();

                case 4:
                    return new Data().ConverteDataDateStringBra(said.getDataSaida());

                case 5:
                    if (said.getSituacao() == 1) {
                        return "Lançada";
                    } else if (said.getSituacao() == 2) {
                        return "Confirmada";
                    } else if (said.getSituacao() == 3) {
                        return "Cancelada";
                    }

                case 6:
                    return new Moeda(said.getValorTotal()).toString();

                default:
                    return null;
            }
        }

        @Override
        public int getRowCount() {
            return lista == null ? 0 : lista.size();
        }

        @Override
        public int getColumnCount() {
            return campos.length;
        }

        @Override
        public String getColumnName(int column) {
            return campos[column];
        }
    }

    public void abrirIFrame(JInternalFrame janela) {
        //        for (JInternalFrame j : TelaPrincipal.desktop.getAllFrames()) {
//            if (janela.getClass() == j.getClass()) {
//                return;
//            }
//        }
        TelaPrincipal.desktop.add(janela);
        janela.moveToFront();
        janela.setVisible(true);
    }
    //    "Id", "N°", "Depósito", "Tipo", "Data", "Situação", "Valor R$"

    public void imprimirSaidas() {
        List<HashMap<String, String>> lista = new ArrayList();
        for (int i = 0; i < saidas.size(); i++) {
            HashMap<String, String> mapa = new HashMap();

            mapa.put("id", String.valueOf(i + 1));
            mapa.put("numero", String.valueOf(saidas.get(i).getId()));
            mapa.put("deposito", saidas.get(i).getTipoSaida().getDepositoFinanceiro().getDescricao());
            mapa.put("tipoEntrada", saidas.get(i).getTipoSaida().getDescricao());
            mapa.put("data", DataUtil.toString(saidas.get(i).getDataSaida(), "dd/MM/yyyy"));
            mapa.put("valor", new Moeda(saidas.get(i).getValorTotal()).toString());
            if (saidas.get(i).getSituacao() == 1) {
                mapa.put("situacao", "Lançada");
            } else if (saidas.get(i).getSituacao() == 2) {
                mapa.put("situacao", "Confirmada");
            } else if (saidas.get(i).getSituacao() == 3) {
                mapa.put("situacao", "Cancelada");
            }
            lista.add(mapa);
        }
        Map parametros = new HashMap();
        Class classpath = new RelatorioUtil().getClass();
        URL url = classpath.getResource("/asfabdesk/apresentacao/resources/busyicons/Logo-ASFAB-degrade.png");
        String img = url.toString();
        parametros.put("filtros", relatorioEntradas);
        parametros.put("img", img);
        parametros.put("usuario", TelaLogin.usuario.getNome());
        parametros.put("data1", DataUtil.toString(dataInicioSaida, "dd/MM/yyyy"));
        parametros.put("data2", DataUtil.toString(dataFimSaida, "dd/MM/yyyy"));
        parametros.put("valorTotal", new Moeda(valorTotalSaidas).imprimiComCifrao());

        try {
            parametros.put("deposito", depositoSaida.getDescricao());
        } catch (Exception e) {
        }
        try {
            parametros.put("tipoEntrada", tipoSaida.getDescricao());
        } catch (Exception e) {
        }

        new RelatorioUtil().imprimir("Saidas", "Saidas", lista, parametros);
    }

    // ################################## CÓDIGOS DA ABA EXTRATO ###############################################################################
    public void FiltrarExtrato(DepositoFinanceiro deposito, Date data1, Date data2) {
        if (deposito != null) {
            extrato = new DAO().listar(HistoricoFinanceiro.class, "HistoricoPorDeposito", data1, data2, deposito);
            atualizarTabelaExtrato(extrato, deposito);
        } else {
            JOptionPane.showMessageDialog(null, "Ops, selecione um Depósito", "Ops", 2);
        }
    }

    public void AplicarFiltrosExtrato() throws ParseException {
        depositoExtrato = new DAO().localizar(DepositoFinanceiro.class, "depositoPorNome", comboDepositoExt.getSelectedItem().toString());
        dataInicioExtrato = new Data().ConverteDataHoraStringDate(txtInicioExt.getText());
        dataFimExtrato = new Data().ConverteDataHoraStringDate(txtFimExt.getText());
        FiltrarExtrato(depositoExtrato, dataInicioExtrato, dataFimExtrato);
    }

    public void configurarComboDepositoExtrato() throws SQLException {
        comboDepositoExt.addItem("");
        comboDepositoExt.setSelectedItem("");
        java.util.List depositos = (new DAO()).listar(DepositoFinanceiro.class);
        for (int i = 0; i < depositos.size(); i++) {
            String descricao = ((DepositoFinanceiro) depositos.get(i)).getDescricao();
            comboDepositoExt.addItem(descricao);
        }
    }

    public void atualizarTabelaExtrato(List<HistoricoFinanceiro> historico, DepositoFinanceiro deposito) {
        tabelaExtrato.setModel(new ModeloExtrato(historico));
        saldoAtualExtrato = deposito.getFundoMonetario();
        txtTotalExt.setText(new Moeda(saldoAtualExtrato).toString());
        txtDepositoExtrato.setText(deposito.getDescricao());
    }

    private class ModeloExtrato extends DefaultTableModel {

        private List<HistoricoFinanceiro> lista;
        private String[] campos = new String[]{"Data", "Movimentação", "Número", "Depósito", "Saldo Anterior", "Valor Movimentação", "Saldo Posterior"};

        public ModeloExtrato(List<HistoricoFinanceiro> list) {
            lista = list;
        }

        public ModeloExtrato() {
        }

        public HistoricoFinanceiro getExtrato(int index) {
            return lista.get(index);
        }

        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }

        @Override
        public Object getValueAt(int row, int column) {
            HistoricoFinanceiro historico = lista.get(row);
            Date data = null;
            String movimentacao = "";
            String deposito = "";
            double saldoAnt = 0;
            double valorMov = 0;
            double saldoPost = 0;
            long numero = 0;
            int tipoMov = historico.getTipo();
            int motivo = historico.getMotivo();
            if (tipoMov == 1) {// Tipo Movimentação = Entrada
                movimentacao = getMotivoMov(motivo);
                data = getDataMovimentacaoEntrada(motivo, historico.getEntrada());
                deposito = historico.getEntrada().getTipoEntrada().getDepositoFinanceiro().getDescricao();
                saldoAnt = historico.getEntrada().getFundoDepPre();
                valorMov = historico.getEntrada().getValorTotal();
                saldoPost = historico.getEntrada().getFundoDepPos();
                numero = historico.getEntrada().getId();
            } else if (tipoMov == 2) {// Tipo Movimentação = Saída
                movimentacao = getMotivoMov(motivo);
                data = getDataMovimentacaoSaida(motivo, historico.getSaida());
                deposito = historico.getSaida().getTipoSaida().getDepositoFinanceiro().getDescricao();
                saldoAnt = historico.getSaida().getFundoDepPre();
                valorMov = historico.getSaida().getValorTotal();
                saldoPost = historico.getSaida().getFundoDepPos();
                numero = historico.getSaida().getId();
            } else if (tipoMov == 3) {// Tipo Movimentação = Entrada Transf.
                movimentacao = getMotivoMov(motivo) + " (" + historico.getEntradaTransf().getDepositoOrigem().getDescricao() + ")";
                data = historico.getDataRegistro();
                deposito = historico.getDepositoFinanceiro().getDescricao();
                saldoAnt = historico.getEntradaTransf().getSaldoAnterior();
                valorMov = historico.getEntradaTransf().getSaidaTransferencia().getValorTransf();
                saldoPost = historico.getEntradaTransf().getSaldoPost();
                numero = historico.getId();
            } else if (tipoMov == 4) {// Tipo Movimentação = Saida Transf.
                movimentacao = getMotivoMov(motivo) + " (" + historico.getSaidaTransf().getDepositoDestino().getDescricao() + ")";
                data = historico.getDataRegistro();
                deposito = historico.getDepositoFinanceiro().getDescricao();
                saldoAnt = historico.getSaidaTransf().getSaldoAnteriorOrigem();
                valorMov = historico.getSaidaTransf().getValorTransf();
                saldoPost = historico.getSaidaTransf().getSaldoPostOrigem();
                numero = historico.getId();
            }

            switch (column) {
                case 0:

                    return new Data().ConverteDataDateStringBra(data);

                case 1:
                    return movimentacao;

                case 2:
                    return numero;

                case 3:
                    return deposito;

                case 4:
                    return new Moeda(saldoAnt).toString();

                case 5:
                    if (motivo == 1 || motivo == 5 || motivo == 6 || motivo == 7) {
                        return "+ " + new Moeda(valorMov).toString();
                    } else if (motivo == 2 || motivo == 3 || motivo == 4 || motivo == 8) {
                        return "- " + new Moeda(valorMov).toString();
                    }

                case 6:
                    return new Moeda(saldoPost).toString();

                default:
                    return null;
            }
        }

        @Override
        public int getRowCount() {
            return lista == null ? 0 : lista.size();
        }

        @Override
        public int getColumnCount() {
            return campos.length;
        }

        @Override
        public String getColumnName(int column) {
            return campos[column];
        }
    }

    public String getMotivoMov(int motivo) {
        String retorno = "";
        if (motivo == 1) {
            retorno = "Entrada Confirmada";
            return retorno;
        } else if (motivo == 2) {
            retorno = "Entrada Estornada";
            return retorno;
        } else if (motivo == 3) {
            retorno = "Entrada Cancelada";
            return retorno;
        } else if (motivo == 4) {
            retorno = "Saída Confirmada";
            return retorno;
        } else if (motivo == 5) {
            retorno = "Saída Estornada";
            return retorno;
        } else if (motivo == 6) {
            retorno = "Saída Cancelada";
            return retorno;
        } else if (motivo == 7) {
            retorno = "Transferência +";
            return retorno;
        } else if (motivo == 8) {
            retorno = "Tranferência -";
            return retorno;
        }
        return retorno;
    }

    public Date getDataMovimentacaoEntrada(int motivo, EntradaFinanceira entrada) {
        Date retorno;
        if (motivo == 1) {
            retorno = entrada.getDataConfirmacao();
            return retorno;
        } else if (motivo == 2) {
            retorno = entrada.getDataEstorno();
            return retorno;
        } else if (motivo == 3) {
            retorno = entrada.getDataCancelamento();
            return retorno;
        }
        return null;
    }

    public Date getDataMovimentacaoSaida(int motivo, SaidaFinanceira saida) {
        Date retorno;
        if (motivo == 4) {
            retorno = saida.getDataConfirmacao();
            return retorno;
        } else if (motivo == 5) {
            retorno = saida.getDataEstorno();
            return retorno;
        } else if (motivo == 6) {
            retorno = saida.getDataCancelamento();
            return retorno;
        }
        return null;
    }

    // "Data", "Movimentação", "Número", "Depósito", "Saldo Anterior", "Valor Movimentação", "Saldo Posterior"
    public void imprimirExtrato() {
        ModeloExtrato modelo = new ModeloExtrato(extrato);
        List<HashMap<String, String>> lista = new ArrayList();
        for (int i = 0; i < extrato.size(); i++) {
            Date data = null;
            String movimentacao = "";
            String deposito = "";
            double saldoAnt = 0;
            double valorMov = 0;
            double saldoPost = 0;
            long numero = 0;
            int tipoMov = extrato.get(i).getTipo();
            int motivo = extrato.get(i).getMotivo();
            if (tipoMov == 1) {// Tipo Movimentação = Entrada
                movimentacao = getMotivoMov(motivo);
                data = getDataMovimentacaoEntrada(motivo, extrato.get(i).getEntrada());
                deposito = extrato.get(i).getEntrada().getTipoEntrada().getDepositoFinanceiro().getDescricao();
                saldoAnt = extrato.get(i).getEntrada().getFundoDepPre();
                valorMov = extrato.get(i).getEntrada().getValorTotal();
                saldoPost = extrato.get(i).getEntrada().getFundoDepPos();
                numero = extrato.get(i).getEntrada().getId();
            } else if (tipoMov == 2) {// Tipo Movimentação = Saída
                movimentacao = getMotivoMov(motivo);
                data = getDataMovimentacaoSaida(motivo, extrato.get(i).getSaida());
                deposito = extrato.get(i).getSaida().getTipoSaida().getDepositoFinanceiro().getDescricao();
                saldoAnt = extrato.get(i).getSaida().getFundoDepPre();
                valorMov = extrato.get(i).getSaida().getValorTotal();
                saldoPost = extrato.get(i).getSaida().getFundoDepPos();
                numero = extrato.get(i).getSaida().getId();
            } else if (tipoMov == 3) {// Tipo Movimentação = Entrada Transf.
                movimentacao = getMotivoMov(motivo) + " (" + extrato.get(i).getEntradaTransf().getDepositoOrigem().getDescricao() + ")";
                data = extrato.get(i).getDataRegistro();
                deposito = extrato.get(i).getDepositoFinanceiro().getDescricao();
                saldoAnt = extrato.get(i).getEntradaTransf().getSaldoAnterior();
                valorMov = extrato.get(i).getEntradaTransf().getSaidaTransferencia().getValorTransf();
                saldoPost = extrato.get(i).getEntradaTransf().getSaldoPost();
                numero = extrato.get(i).getId();
            } else if (tipoMov == 4) {// Tipo Movimentação = Saida Transf.
                movimentacao = getMotivoMov(motivo) + " (" + extrato.get(i).getSaidaTransf().getDepositoDestino().getDescricao() + ")";
                data = extrato.get(i).getDataRegistro();
                deposito = extrato.get(i).getDepositoFinanceiro().getDescricao();
                saldoAnt = extrato.get(i).getSaidaTransf().getSaldoAnteriorOrigem();
                valorMov = extrato.get(i).getSaidaTransf().getValorTransf();
                saldoPost = extrato.get(i).getSaidaTransf().getSaldoPostOrigem();
                numero = extrato.get(i).getId();
            }

            HashMap<String, String> mapa = new HashMap();
            mapa.put("id", String.valueOf(i + 1));
            mapa.put("data", DataUtil.toString(data, "dd/MM/yyyy"));
            mapa.put("movimentacao", movimentacao);
            mapa.put("numero", String.valueOf(numero));
            mapa.put("saldoAnterior", new Moeda(saldoAnt).toString());
            mapa.put("valorMov", new Moeda(valorMov).toString());
            mapa.put("saldoPosterior", new Moeda(saldoPost).toString());
            if (motivo == 1 || motivo == 5 || motivo == 6 || motivo == 7) {
                mapa.put("sinal", "+");
            } else if (motivo == 2 || motivo == 3 || motivo == 4 || motivo == 8) {
                mapa.put("sinal", "-");
            }
            lista.add(mapa);
        }
        Map parametros = new HashMap();
        Class classpath = new RelatorioUtil().getClass();
        URL url = classpath.getResource("/asfabdesk/apresentacao/resources/busyicons/Logo-ASFAB-degrade.png");
        String img = url.toString();
        parametros.put("img", img);
        parametros.put("usuario", TelaLogin.usuario.getNome());
        parametros.put("data1", DataUtil.toString(dataInicioExtrato, "dd/MM/yyyy"));
        parametros.put("data2", DataUtil.toString(dataFimExtrato, "dd/MM/yyyy"));
        parametros.put("saldoAtual", new Moeda(saldoAtualExtrato).imprimiComCifrao());
        parametros.put("deposito", depositoExtrato.getDescricao());

        new RelatorioUtil().imprimir("Extrato", "Extrato", lista, parametros);
    }

    // ########################################### CÓDIGOS DA ABA CONVENIOS ###################################################
    public void configurarComboConvenioConv() throws SQLException {
        comboConvenioConv.removeAllItems();
        comboConvenioConv.addItem("");
        comboConvenioConv.setSelectedItem("");
        java.util.List conv = (new DAO()).listar(Convenio.class);
        for (int i = 0; i < conv.size(); i++) {
            String descricao = ((Convenio) conv.get(i)).getNome();
            comboConvenioConv.addItem(descricao);
        }
    }

    public void selecionarFiltroConvenios() throws ParseException {

        if (radioAdimplentesConv.isSelected()) {
            filtrarConvenioCompAdimpli();
        } else if (radioInadimplentesConv.isSelected()) {
            filtrarConvenioCompInadimp();
        }
//        if (radioAdimplentesConv.isSelected() && radioCompetenciaConv.isSelected()) {
//            filtrarConvenioCompAdimpli();
//        } else if (radioAdimplentesConv.isSelected() && radioPeriodoConv.isSelected()) {
//            filtrarConvenioPeriodoAdimpli();
//        } else if (radioInadimplentesConv.isSelected() && radioCompetenciaConv.isSelected()) {
//            filtrarConvenioCompInadimp();
//        } else if (radioInadimplentesConv.isSelected() && radioPeriodoConv.isSelected()) {
//            filtrarConvenioPeriodoInadimp();
//        }
    }

//    public void filtrarConvenioPeriodoAdimpli() throws ParseException {
//        Convenio conv = new DAO().localizar(Convenio.class, "ConvenioPorNome", comboConvenioConv.getSelectedItem().toString());
//        Date data1 = new Data().ConverteDataStringDate(txtInicioConv.getText());
//        Date data2 = new Data().ConverteDataStringDate(txtFimConv.getText());
//        selecionarConvenioPeriodoAdimpli(conv, data1, data2);
//    }
//
//    public void selecionarConvenioPeriodoAdimpli(Convenio conv, Date data1, Date data2) {
//        Date comp1 = data1;
//        comp1.setDate(01);
//        Date comp2 = data2;
//        comp2.setDate(02);
//        List<ItemEntrada> itens = new ArrayList<ItemEntrada>();
//        itens = new DAO().listar(ItemEntrada.class, "ItensPorConvenioPeriodo", conv, comp1, comp2);
//        tabelaConvenio.setModel(new ModeloConvenioAdimplente(itens));
//    }
    public void filtrarConvenioCompAdimpli() throws ParseException {
        Convenio conv = new DAO().localizar(Convenio.class, "ConvenioPorNome", comboConvenioConv.getSelectedItem().toString());
        int comp = Integer.valueOf(comboCompConv.getSelectedItem().toString());
        int anoc = Integer.valueOf(comboAnoConv.getSelectedItem().toString());
        Date compe = new Data().ConverteDataStringDate("01" + "/" + comp + "/" + anoc);
        selecionarConvenioCompAdimpli(conv, compe);
    }

    public void selecionarConvenioCompAdimpli(Convenio conv, Date comp) throws ParseException {

        List<ItemEntrada> itens = new ArrayList<ItemEntrada>();
        itens = new DAO().listar(ItemEntrada.class, "ItensPorConvenioComp", conv, comp);
        tabelaConvenio.setModel(new ModeloConvenioAdimplente(itens));
    }

//    public void filtrarConvenioPeriodoInadimp() throws ParseException {
//        Convenio conv = new DAO().localizar(Convenio.class, "ConvenioPorNome", comboConvenioConv.getSelectedItem().toString());
//        Date data1 = new Data().ConverteDataStringDate(txtInicioConv.getText());
//        Date data2 = new Data().ConverteDataStringDate(txtFimConv.getText());
//        selecionarConvenioPeriodoInadimp(conv, data1, data2);
//    }
//
//    public void selecionarConvenioPeriodoInadimp(Convenio conv, Date data1, Date data2) throws ParseException {
//        Date comp1 = data1;
//        comp1.setDate(01);
//        Date comp2 = data2;
//        comp2.setDate(02);
//        List<ItemEntrada> itensPagos = new ArrayList<ItemEntrada>();
//        List<InadimplenciaConvenio> inadimplentes = new ArrayList<InadimplenciaConvenio>();
//        List<ConvenioPorAssociado> associadosPorConv = new ArrayList<ConvenioPorAssociado>();
//        List<ConvenioPorDependente> dependentesPorConv = new ArrayList<ConvenioPorDependente>();
//        itensPagos = new DAO().listar(ItemEntrada.class, "ItensPorConvenioPeriodo", conv, comp1, comp2);
//        associadosPorConv = new DAO().listar(ConvenioPorAssociado.class, "ConveniosPorAssociados", conv, data1);
//        dependentesPorConv = new DAO().listar(ConvenioPorDependente.class, "ConveniosPorDependentes", conv, data1);
//
//        for (ItemEntrada i : itensPagos) {
//            for (int c = 0; c < associadosPorConv.size(); c++) {
//                if (associadosPorConv.get(c).getAssociado().getId() == i.getAssociado().getId()) {
//                    associadosPorConv.remove(c);
//                }
//            }
//        }
//
//        for (ConvenioPorAssociado c : associadosPorConv) {
//            inadimplentes.add(new InadimplenciaConvenio(conv.getValor(), c.getAssociado(), null, c.getConvenio()));
//        }
//
//        for (ItemEntrada i : itensPagos) {
//            for (int c = 0; c < dependentesPorConv.size(); c++) {
//                if (dependentesPorConv.get(c).getDependente().getId() == i.getDependente().getId()) {
//                    dependentesPorConv.remove(c);
//                }
//            }
//        }
//        for (ConvenioPorDependente c : dependentesPorConv) {
//            inadimplentes.add(new InadimplenciaConvenio(conv.getValor(), null, c.getDependente(), c.getConvenio()));
//        }
//        tabelaConvenio.setModel(new ModeloConvenioInadimplente(inadimplentes));
//    }
    public void filtrarConvenioCompInadimp() throws ParseException {
        Convenio conv = new DAO().localizar(Convenio.class, "ConvenioPorNome", comboConvenioConv.getSelectedItem().toString());
        int comp = Integer.valueOf(comboCompConv.getSelectedItem().toString());
        int anoc = Integer.valueOf(comboAnoConv.getSelectedItem().toString());
        Date compe = new Data().ConverteDataStringDate("01" + "/" + comp + "/" + anoc);
        selecionarConvenioCompInadimp(conv, compe);
    }

    public void selecionarConvenioCompInadimp(Convenio conv, Date comp) throws ParseException {

        List<ItemEntrada> itensPagos = new ArrayList<ItemEntrada>();
        List<InadimplenciaConvenio> inadimplentes = new ArrayList<InadimplenciaConvenio>();
        List<ConvenioPorAssociado> associadosPorConv = new ArrayList<ConvenioPorAssociado>();
        List<ConvenioPorDependente> dependentesPorConv = new ArrayList<ConvenioPorDependente>();
        itensPagos = new DAO().listar(ItemEntrada.class, "ItensPorConvenioComp", conv, comp);
        associadosPorConv = new DAO().listar(ConvenioPorAssociado.class, "ConveniosPorAssociados", conv, comp);
        dependentesPorConv = new DAO().listar(ConvenioPorDependente.class, "ConveniosPorDependentes", conv, comp);


        for (ItemEntrada i : itensPagos) {
            for (int c = 0; c < associadosPorConv.size(); c++) {
                if (associadosPorConv.get(c).getAssociado().getId() == i.getAssociado().getId()) {
                    associadosPorConv.remove(c);
                }
            }
        }

        for (ConvenioPorAssociado c : associadosPorConv) {
            inadimplentes.add(new InadimplenciaConvenio(conv.getValor(), c.getAssociado(), null, c.getConvenio(), comp));
        }

        for (ItemEntrada i : itensPagos) {
            for (int c = 0; c < dependentesPorConv.size(); c++) {
                if (dependentesPorConv.get(c).getDependente().getId() == i.getDependente().getId()) {
                    dependentesPorConv.remove(c);
                }
            }
        }
        for (ConvenioPorDependente c : dependentesPorConv) {
            inadimplentes.add(new InadimplenciaConvenio(conv.getValor(), null, c.getDependente(), c.getConvenio(), comp));
        }
        tabelaConvenio.setModel(new ModeloConvenioInadimplente(inadimplentes));
    }

    private class ModeloConvenioAdimplente extends DefaultTableModel {

        private List<ItemEntrada> itens;
        private String[] campos = new String[]{"Id", "Nome", "Ligação", "Situação", "Entrada", "Comp.", "Ano", "Valor", "Pago"};

        public ModeloConvenioAdimplente(List<ItemEntrada> itens) {
            this.itens = itens;
        }

        public ModeloConvenioAdimplente() {
        }

        public ItemEntrada getItem(int index) {
            return itens.get(index);
        }

        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }

        @Override
        public Object getValueAt(int row, int column) {

            ItemEntrada item = itens.get(row);
            String nome = "";
            String ligacao = "";
            String situacao = "";

            if (item.getAssociado() != null) {
                nome = item.getAssociado().getNome();
                ligacao = "Associado";
                if (item.getAssociado().isAtivo()) {
                    situacao = "Ativo";
                } else {
                    situacao = "Inativo";
                }
            } else if (item.getDependente() != null) {
                nome = item.getDependente().getNome();
                ligacao = "Dependente";
                if (item.getDependente().isAtivo()) {
                    situacao = "Ativo";
                } else {
                    situacao = "Inativo";
                }
            }

            switch (column) {
                case 0:
                    return row + 1;

                case 1:
                    return nome;

                case 2:
                    return ligacao;

                case 3:
                    return situacao;

                case 4:
                    return item.getEntrada().getId();

                case 5:
                    return DataUtil.escreverMesNumerado(item.getEntrada().getCompetencia());

                case 6:
                    return DataUtil.toString(item.getEntrada().getCompetencia(), "yyyy");

                case 7:
                    return new Moeda(item.getValorIten()).toString();

                case 8:
                    return "SIM";

                default:
                    return null;
            }
        }

        @Override
        public int getRowCount() {
            return itens == null ? 0 : itens.size();
        }

        @Override
        public int getColumnCount() {
            return campos.length;
        }

        @Override
        public String getColumnName(int column) {
            return campos[column];
        }
    }

    private class ModeloConvenioInadimplente extends DefaultTableModel {

        private List<InadimplenciaConvenio> itens;
        private String[] campos = new String[]{"Id", "Nome", "Ligação", "Situação", "Comp.", "Ano", "Valor", "Pago", "Selecionar"};

        public ModeloConvenioInadimplente(List<InadimplenciaConvenio> itens) {
            this.itens = itens;
        }

        public ModeloConvenioInadimplente() {
        }

        public InadimplenciaConvenio getItem(int index) {
            return itens.get(index);
        }

        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }

        @Override
        public Object getValueAt(int row, int column) {

            InadimplenciaConvenio item = itens.get(row);
            String nome = "";
            String ligacao = "";
            String situacao = "";

            if (item.getAssociado() != null) {
                nome = item.getAssociado().getNome();
                ligacao = "Associado";
                if (item.getAssociado().isAtivo()) {
                    situacao = "Ativo";
                } else {
                    situacao = "Inativo";
                }
            } else if (item.getDependente() != null) {
                nome = item.getDependente().getNome();
                ligacao = "Dependente";
                if (item.getDependente().isAtivo()) {
                    situacao = "Ativo";
                } else {
                    situacao = "Inativo";
                }
            }

            switch (column) {
                case 0:
                    return row + 1;


                case 1:
                    return nome;

                case 2:
                    return ligacao;

                case 3:
                    return situacao;

                case 4:
//                    return DataUtil.escreverMesNumerado(item.getCompetencia());

                case 5:
//                    return DataUtil.toString(item.getCompetencia(), "yyyy");

                case 6:
                    return new Moeda(item.getValor()).toString();
                case 7:
                    return "NÃO";

                case 8:
                    return "";

                default:
                    return null;
            }
        }

        @Override
        public int getRowCount() {
            return itens == null ? 0 : itens.size();
        }

        @Override
        public int getColumnCount() {
            return campos.length;
        }

        @Override
        public String getColumnName(int column) {
            return campos[column];
        }
    }

    // ################################################# CÓDIGOS DA ABA CONTRIBUIÇÕES ################################################
    public void selecionarFiltroContribuicoes() throws ParseException {
        if (radioAdimplentesCont.isSelected()) {
            filtrarContribuicaoCompAdimple();
        } else if (radioInadimplentesCont.isSelected()) {
            filtrarContribuicaoCompInadimp();
        }
    }

    public void filtrarContribuicaoCompAdimple() throws ParseException {
        List<ItemEntrada> itens = new ArrayList<ItemEntrada>();
        int comp1 = Integer.valueOf(comboCompCont1.getSelectedItem().toString());
        int ano1 = Integer.valueOf(comboAnoCont1.getSelectedItem().toString());
        Date competencia1 = new Data().ConverteDataStringDate("01" + "/" + comp1 + "/" + ano1);
        int comp2 = Integer.valueOf(comboCompCont2.getSelectedItem().toString());
        int ano2 = Integer.valueOf(comboAnoCont2.getSelectedItem().toString());
        Date competencia2 = new Data().ConverteDataStringDate("01" + "/" + comp2 + "/" + ano2);
        DateTime dt1 = DataUtil.getDateTime(competencia1);
        DateTime dt2 = DataUtil.getDateTime(competencia2);
        if (DataUtil.getDiferencaEmDias(dt2, dt1) < 0) {
            JOptionPane.showMessageDialog(null, "Ops, a Competência 1 não pode ser maior que a Competência 2!", "Ops", 2);
            return;
        }

        if (DataUtil.compararDia(dt1, dt2)) {
            itens = selecionarContribuicaoCompAdimple(dt1);
        } else {
            while (DataUtil.compararDia(dt1, dt2) == false) {

                Date d = DataUtil.getDate(dt1);
                List<ItemEntrada> itensAux1 = selecionarContribuicaoCompAdimple(dt1);
                for (ItemEntrada i : itensAux1) {
                    itens.add(i);
                }
                d.setDate(d.getDate() + 31);
                dt1 = DataUtil.getDateTime(d);
                dt1 = DataUtil.getPrimeiroDiaMes(dt1);
                if (DataUtil.compararDia(dt1, dt2)) {
                    List<ItemEntrada> itensAux2 = selecionarContribuicaoCompAdimple(dt1);
                    for (ItemEntrada i : itensAux2) {
                        itens.add(i);
                    }
                }
            }
        }
        tabelaContribuicao.setModel(new ModeloContribuicaoAdimplente(itens));
    }

    public List<ItemEntrada> selecionarContribuicaoCompAdimple(DateTime compet) throws ParseException {
        Date comp = DataUtil.getDate(compet);
        List<ItemEntrada> itens = new ArrayList<ItemEntrada>();
        itens = new DAO().listar(ItemEntrada.class, "ItensPorContribuicaoCont", comp);
        associadosContAdimple = itens;
        return itens;
    }

    public void filtrarContribuicaoCompInadimp() throws ParseException {
        ArrayList<Associado> inadimplentes = new ArrayList<Associado>();
        List<Associado> inadimplentesAux = new ArrayList<Associado>();
        int comp1 = Integer.valueOf(comboCompCont1.getSelectedItem().toString());
        int ano1 = Integer.valueOf(comboAnoCont1.getSelectedItem().toString());
        Date competencia1 = new Data().ConverteDataStringDate("01" + "/" + comp1 + "/" + ano1);
        int comp2 = Integer.valueOf(comboCompCont2.getSelectedItem().toString());
        int ano2 = Integer.valueOf(comboAnoCont2.getSelectedItem().toString());
        Date competencia2 = new Data().ConverteDataStringDate("01" + "/" + comp2 + "/" + ano2);
        DateTime dt1 = DataUtil.getDateTime(competencia1);
        DateTime dt2 = DataUtil.getDateTime(competencia2);
        if (DataUtil.getDiferencaEmDias(dt2, dt1) < 0) {
            JOptionPane.showMessageDialog(null, "Ops, a Competência 1 não pode ser maior que a Competência 2!", "Ops", 2);
            return;
        }
        int meses = 0;

        if (DataUtil.compararDia(dt1, dt2)) {
            inadimplentes = (ArrayList<Associado>) selecionarContribuicaoCompInadimp(dt1);
        } else {
            while (DataUtil.compararDia(dt1, dt2) == false) {
                meses++;
                Date d = DataUtil.getDate(dt1);
                List<Associado> inadimplentesAux1 = selecionarContribuicaoCompInadimp(dt1);
                for (Associado i : inadimplentesAux1) {
                    inadimplentesAux.add(i);
                }
                d.setDate(d.getDate() + 31);
                dt1 = DataUtil.getDateTime(d);
                dt1 = DataUtil.getPrimeiroDiaMes(dt1);
                if (DataUtil.compararDia(dt1, dt2)) {
                    meses++;
                    List<Associado> inadimplentesAux2 = selecionarContribuicaoCompInadimp(dt1);
                    for (Associado i : inadimplentesAux2) {
                        inadimplentesAux.add(i);
                    }
                }
            }
            for (int i = 0; i < inadimplentesAux.size(); i++) {
                int cont = 0;
                for (int j = 0; j < inadimplentesAux.size(); j++) {
                    if (inadimplentesAux.get(i).getId() == inadimplentesAux.get(j).getId()) {
                        cont = cont + 1;
                    }
                }
                if (cont == meses) {
                    inadimplentes.add(inadimplentesAux.get(i));
                    inadimplentesAux.remove(i);
                }
            }
        }
        tabelaContribuicao.setModel(new ModeloContribuicaoInadimplente(inadimplentes));
    }

    public List<Associado> selecionarContribuicaoCompInadimp(DateTime compet) throws ParseException {
        Date comp = DataUtil.getDate(compet);
        List<ItemEntrada> itensPagos = new ArrayList<ItemEntrada>();
        List<Associado> associados = new ArrayList<Associado>();
        itensPagos = new DAO().listar(ItemEntrada.class, "ItensPorContribuicaoCont", comp);
        associados = new DAO().listar(Associado.class, "AssociadosParaContribuicao", comp);

        for (ItemEntrada i : itensPagos) {
            for (int c = 0; c < associados.size(); c++) {
                if (associados.get(c).getId() == i.getAssociado().getId()) {
                    associados.remove(c);
                }
            }
        }
        associadosContInadimple = associados;
        return associados;
    }

    private class ModeloContribuicaoAdimplente extends DefaultTableModel {

        private List<ItemEntrada> itens;
        private String[] campos = new String[]{"Id", "Nome", "Ligação", "Situação", "Entrada", "Comp.", "Ano", "Valor", "Pago"};

        public ModeloContribuicaoAdimplente(List<ItemEntrada> itens) {
            this.itens = itens;
        }

        public ModeloContribuicaoAdimplente() {
        }

        public ItemEntrada getItem(int index) {
            return itens.get(index);
        }

        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }

        @Override
        public Object getValueAt(int row, int column) {

            ItemEntrada item = itens.get(row);
            String nome = "";
            String ligacao = "";
            String situacao = "";

            if (item.getAssociado() != null) {
                nome = item.getAssociado().getNome();
                ligacao = "Associado";
                if (item.getAssociado().isAtivo()) {
                    situacao = "Ativo";
                } else {
                    situacao = "Inativo";
                }
            } else if (item.getDependente() != null) {
                nome = item.getDependente().getNome();
                ligacao = "Dependente";
                if (item.getDependente().isAtivo()) {
                    situacao = "Ativo";
                } else {
                    situacao = "Inativo";
                }
            }

            switch (column) {
                case 0:
                    return row + 1;

                case 1:
                    return nome;

                case 2:
                    return ligacao;

                case 3:
                    return situacao;

                case 4:
                    return item.getEntrada().getId();

                case 5:
                    return DataUtil.escreverMesNumerado(item.getEntrada().getCompetencia());

                case 6:
                    return DataUtil.toString(item.getEntrada().getCompetencia(), "yyyy");

                case 7:
                    return new Moeda(item.getValorIten()).toString();

                case 8:
                    return "SIM";

                default:
                    return null;
            }
        }

        @Override
        public int getRowCount() {
            return itens == null ? 0 : itens.size();
        }

        @Override
        public int getColumnCount() {
            return campos.length;
        }

        @Override
        public String getColumnName(int column) {
            return campos[column];
        }
    }

    private class ModeloContribuicaoInadimplente extends DefaultTableModel {

        private List<Associado> associados;
        private String[] campos = new String[]{"Id", "Nome", "ROL", "Situação",};

        public ModeloContribuicaoInadimplente(List<Associado> itens) {
            this.associados = itens;
        }

        public ModeloContribuicaoInadimplente() {
        }

        public Associado getItem(int index) {
            return associados.get(index);
        }

        @Override
        public boolean isCellEditable(int row, int column) {
            return false;
        }

        @Override
        public Object getValueAt(int row, int column) {

            Associado associado = associados.get(row);

            switch (column) {
                case 0:
                    return row + 1;

                case 1:
                    return associado.getNome();

                case 2:
                    return associado.getRol();

                case 3:
                    if (associado.isAtivo()) {
                        return "Ativo";
                    } else {
                        return "Inativo";
                    }

                default:
                    return null;
            }
        }

        @Override
        public int getRowCount() {
            return associados == null ? 0 : associados.size();
        }

        @Override
        public int getColumnCount() {
            return campos.length;
        }

        @Override
        public String getColumnName(int column) {
            return campos[column];
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        Entradas = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tabelaEntradas = new javax.swing.JTable();
        jPanel8 = new javax.swing.JPanel();
        jLabel12 = new javax.swing.JLabel();
        comboComptEnt = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        comboDepEnt = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        comboTipoEnt = new javax.swing.JComboBox();
        comboAnoEnt = new javax.swing.JComboBox();
        jLabel13 = new javax.swing.JLabel();
        txtInicioEnt = new javax.swing.JFormattedTextField();
        jLabel9 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        comboConv = new javax.swing.JComboBox();
        txtFimEnt = new javax.swing.JFormattedTextField();
        jLabel10 = new javax.swing.JLabel();
        btnFiltrarEntradas = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        comboSitEnt = new javax.swing.JComboBox();
        jPanel10 = new javax.swing.JPanel();
        jToolBar1 = new javax.swing.JToolBar();
        jSeparator7 = new javax.swing.JToolBar.Separator();
        btnNovaEntrada = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JToolBar.Separator();
        btnImprimirEntrada = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JToolBar.Separator();
        btnLimparEntrada = new javax.swing.JButton();
        jSeparator8 = new javax.swing.JToolBar.Separator();
        jPanel9 = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        txtLocalizarEntrada = new javax.swing.JTextField();
        btnLocalizarEntrada = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        txtTotalEntrada = new javax.swing.JLabel();
        Saidas = new javax.swing.JPanel();
        jPanel12 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tabelaSaidas = new javax.swing.JTable();
        jPanel11 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        comboDepositoSaida = new javax.swing.JComboBox();
        comboTipoSaida = new javax.swing.JComboBox();
        txtInicioSaida = new javax.swing.JFormattedTextField();
        jLabel18 = new javax.swing.JLabel();
        txtFimSaida = new javax.swing.JFormattedTextField();
        jLabel20 = new javax.swing.JLabel();
        btnFiltrarSaidas = new javax.swing.JButton();
        jLabel21 = new javax.swing.JLabel();
        comboSitSaida = new javax.swing.JComboBox();
        jPanel13 = new javax.swing.JPanel();
        jToolBar2 = new javax.swing.JToolBar();
        jSeparator5 = new javax.swing.JToolBar.Separator();
        btnNovaSaida = new javax.swing.JButton();
        jSeparator3 = new javax.swing.JToolBar.Separator();
        btnImprimirSaida = new javax.swing.JButton();
        jSeparator4 = new javax.swing.JToolBar.Separator();
        btnLimparSaida = new javax.swing.JButton();
        jSeparator6 = new javax.swing.JToolBar.Separator();
        jPanel14 = new javax.swing.JPanel();
        txtLocalizarSaida = new javax.swing.JTextField();
        btnLocalizarSaida = new javax.swing.JButton();
        jLabel3 = new javax.swing.JLabel();
        txtTotalSaida = new javax.swing.JLabel();
        Extratos = new javax.swing.JPanel();
        jPanel18 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tabelaExtrato = new javax.swing.JTable();
        jPanel19 = new javax.swing.JPanel();
        jToolBar3 = new javax.swing.JToolBar();
        jSeparator9 = new javax.swing.JToolBar.Separator();
        btnImprimirExt = new javax.swing.JButton();
        jSeparator10 = new javax.swing.JToolBar.Separator();
        btnLimparExt = new javax.swing.JButton();
        jSeparator11 = new javax.swing.JToolBar.Separator();
        jLabel4 = new javax.swing.JLabel();
        txtTotalExt = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        txtDepositoExtrato = new javax.swing.JLabel();
        jPanel17 = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();
        comboDepositoExt = new javax.swing.JComboBox();
        txtInicioExt = new javax.swing.JFormattedTextField();
        jLabel23 = new javax.swing.JLabel();
        txtFimExt = new javax.swing.JFormattedTextField();
        jLabel24 = new javax.swing.JLabel();
        btnFiltrarExt = new javax.swing.JButton();
        Convenios = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        tabelaConvenio = new javax.swing.JTable();
        jPanel2 = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        jLabel25 = new javax.swing.JLabel();
        comboAnoConv = new javax.swing.JComboBox();
        comboCompConv = new javax.swing.JComboBox();
        jLabel14 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        radioAdimplentesConv = new javax.swing.JRadioButton();
        radioInadimplentesConv = new javax.swing.JRadioButton();
        jPanel6 = new javax.swing.JPanel();
        comboConvenioConv = new javax.swing.JComboBox();
        btnFiltraConvenios = new javax.swing.JButton();
        Contribuicoes = new javax.swing.JPanel();
        jPanel23 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        tabelaContribuicao = new javax.swing.JTable();
        jPanel16 = new javax.swing.JPanel();
        btnFiltrarContribuicoes = new javax.swing.JButton();
        jPanel21 = new javax.swing.JPanel();
        radioAdimplentesCont = new javax.swing.JRadioButton();
        radioInadimplentesCont = new javax.swing.JRadioButton();
        jPanel20 = new javax.swing.JPanel();
        comboCompCont1 = new javax.swing.JComboBox();
        jLabel28 = new javax.swing.JLabel();
        comboAnoCont1 = new javax.swing.JComboBox();
        comboAnoCont2 = new javax.swing.JComboBox();
        jLabel29 = new javax.swing.JLabel();
        comboCompCont2 = new javax.swing.JComboBox();
        jLabel26 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();

        setClosable(true);
        setIconifiable(true);
        setMaximizable(true);
        setResizable(true);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(asfabdesk.apresentacao.AsfabDeskApp.class).getContext().getResourceMap(TelaFinanceiro.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N

        Entradas.setName("Entradas"); // NOI18N
        Entradas.setOpaque(false);

        jPanel3.setName("jPanel3"); // NOI18N
        jPanel3.setOpaque(false);

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        tabelaEntradas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Id", "Número", "Depósito", "Tipo", "CPT", "Ano", "Data Entrada", "Situação", "Valor R$"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabelaEntradas.setName("tabelaEntradas"); // NOI18N
        tabelaEntradas.setOpaque(false);
        tabelaEntradas.setSelectionBackground(resourceMap.getColor("tabelaEntradas.selectionBackground")); // NOI18N
        tabelaEntradas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelaEntradasMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tabelaEntradas);
        tabelaEntradas.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("tabelaEntradas.columnModel.title0")); // NOI18N
        tabelaEntradas.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("tabelaEntradas.columnModel.title1")); // NOI18N
        tabelaEntradas.getColumnModel().getColumn(2).setHeaderValue(resourceMap.getString("tabelaEntradas.columnModel.title2")); // NOI18N
        tabelaEntradas.getColumnModel().getColumn(3).setHeaderValue(resourceMap.getString("tabelaEntradas.columnModel.title3")); // NOI18N
        tabelaEntradas.getColumnModel().getColumn(4).setHeaderValue(resourceMap.getString("tabelaEntradas.columnModel.title4")); // NOI18N
        tabelaEntradas.getColumnModel().getColumn(5).setHeaderValue(resourceMap.getString("tabelaEntradas.columnModel.title5")); // NOI18N
        tabelaEntradas.getColumnModel().getColumn(6).setHeaderValue(resourceMap.getString("tabelaEntradas.columnModel.title6")); // NOI18N
        tabelaEntradas.getColumnModel().getColumn(7).setHeaderValue(resourceMap.getString("tabelaEntradas.columnModel.title7")); // NOI18N
        tabelaEntradas.getColumnModel().getColumn(8).setHeaderValue(resourceMap.getString("tabelaEntradas.columnModel.title8")); // NOI18N

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel8.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), resourceMap.getColor("jPanel8.border.titleColor"))); // NOI18N
        jPanel8.setName("jPanel8"); // NOI18N
        jPanel8.setOpaque(false);

        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N

        comboComptEnt.setName("comboComptEnt"); // NOI18N

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        comboDepEnt.setName("comboDepEnt"); // NOI18N
        comboDepEnt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboDepEntActionPerformed(evt);
            }
        });

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        comboTipoEnt.setName("comboTipoEnt"); // NOI18N
        comboTipoEnt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboTipoEntActionPerformed(evt);
            }
        });

        comboAnoEnt.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "----", "2011", "2012", "2013", "2014", "2015", "2016" }));
        comboAnoEnt.setName("comboAnoEnt"); // NOI18N

        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N

        try {
            txtInicioEnt.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        txtInicioEnt.setName("txtInicioEnt"); // NOI18N

        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N

        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        comboConv.setName("comboConv"); // NOI18N

        try {
            txtFimEnt.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        txtFimEnt.setName("txtFimEnt"); // NOI18N

        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N

        btnFiltrarEntradas.setIcon(resourceMap.getIcon("btnFiltrarEntradas.icon")); // NOI18N
        btnFiltrarEntradas.setText(resourceMap.getString("btnFiltrarEntradas.text")); // NOI18N
        btnFiltrarEntradas.setName("btnFiltrarEntradas"); // NOI18N
        btnFiltrarEntradas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFiltrarEntradasActionPerformed(evt);
            }
        });

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N

        comboSitEnt.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Confirmada", "Lançada", "Conf/Lanc", "Cancelada" }));
        comboSitEnt.setName("comboSitEnt"); // NOI18N

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboDepEnt, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel6)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboTipoEnt, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel8)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboConv, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboSitEnt, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboComptEnt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboAnoEnt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtInicioEnt, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel10)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtFimEnt, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnFiltrarEntradas)))
                .addContainerGap(98, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(comboDepEnt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(comboTipoEnt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8)
                    .addComponent(comboConv, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(comboSitEnt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12)
                    .addComponent(comboComptEnt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13)
                    .addComponent(comboAnoEnt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9)
                    .addComponent(txtInicioEnt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10)
                    .addComponent(txtFimEnt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnFiltrarEntradas))
                .addContainerGap())
        );

        jPanel10.setMaximumSize(null);
        jPanel10.setName("jPanel10"); // NOI18N
        jPanel10.setOpaque(false);

        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);
        jToolBar1.setName("jToolBar1"); // NOI18N
        jToolBar1.setOpaque(false);

        jSeparator7.setName("jSeparator7"); // NOI18N
        jToolBar1.add(jSeparator7);

        btnNovaEntrada.setIcon(resourceMap.getIcon("btnNovaEntrada.icon")); // NOI18N
        btnNovaEntrada.setText(resourceMap.getString("btnNovaEntrada.text")); // NOI18N
        btnNovaEntrada.setToolTipText(resourceMap.getString("btnNovaEntrada.toolTipText")); // NOI18N
        btnNovaEntrada.setFocusable(false);
        btnNovaEntrada.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnNovaEntrada.setName("btnNovaEntrada"); // NOI18N
        btnNovaEntrada.setOpaque(false);
        btnNovaEntrada.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnNovaEntrada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNovaEntradaActionPerformed(evt);
            }
        });
        jToolBar1.add(btnNovaEntrada);

        jSeparator1.setName("jSeparator1"); // NOI18N
        jToolBar1.add(jSeparator1);

        btnImprimirEntrada.setIcon(resourceMap.getIcon("btnImprimirEntrada.icon")); // NOI18N
        btnImprimirEntrada.setText(resourceMap.getString("btnImprimirEntrada.text")); // NOI18N
        btnImprimirEntrada.setToolTipText(resourceMap.getString("btnImprimirEntrada.toolTipText")); // NOI18N
        btnImprimirEntrada.setFocusable(false);
        btnImprimirEntrada.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnImprimirEntrada.setName("btnImprimirEntrada"); // NOI18N
        btnImprimirEntrada.setOpaque(false);
        btnImprimirEntrada.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnImprimirEntrada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnImprimirEntradaActionPerformed(evt);
            }
        });
        jToolBar1.add(btnImprimirEntrada);

        jSeparator2.setName("jSeparator2"); // NOI18N
        jToolBar1.add(jSeparator2);

        btnLimparEntrada.setIcon(resourceMap.getIcon("btnLimparEntrada.icon")); // NOI18N
        btnLimparEntrada.setText(resourceMap.getString("btnLimparEntrada.text")); // NOI18N
        btnLimparEntrada.setToolTipText(resourceMap.getString("btnLimparEntrada.toolTipText")); // NOI18N
        btnLimparEntrada.setFocusable(false);
        btnLimparEntrada.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnLimparEntrada.setName("btnLimparEntrada"); // NOI18N
        btnLimparEntrada.setOpaque(false);
        btnLimparEntrada.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(btnLimparEntrada);

        jSeparator8.setName("jSeparator8"); // NOI18N
        jToolBar1.add(jSeparator8);

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder("Localizar"));
        jPanel9.setName("jPanel9"); // NOI18N
        jPanel9.setOpaque(false);

        jLabel11.setName("jLabel11"); // NOI18N

        txtLocalizarEntrada.setName("txtLocalizarEntrada"); // NOI18N

        btnLocalizarEntrada.setIcon(resourceMap.getIcon("btnLocalizarEntrada.icon")); // NOI18N
        btnLocalizarEntrada.setName("btnLocalizarEntrada"); // NOI18N

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel11)
                    .addComponent(txtLocalizarEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnLocalizarEntrada)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(txtLocalizarEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnLocalizarEntrada))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        txtTotalEntrada.setBackground(resourceMap.getColor("txtTotalEntrada.background")); // NOI18N
        txtTotalEntrada.setFont(resourceMap.getFont("txtTotalEntrada.font")); // NOI18N
        txtTotalEntrada.setText(resourceMap.getString("txtTotalEntrada.text")); // NOI18N
        txtTotalEntrada.setName("txtTotalEntrada"); // NOI18N
        txtTotalEntrada.setOpaque(true);

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 362, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtTotalEntrada, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(txtTotalEntrada, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 858, Short.MAX_VALUE)
                    .addComponent(jPanel8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 248, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout EntradasLayout = new javax.swing.GroupLayout(Entradas);
        Entradas.setLayout(EntradasLayout);
        EntradasLayout.setHorizontalGroup(
            EntradasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        EntradasLayout.setVerticalGroup(
            EntradasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab(resourceMap.getString("Entradas.TabConstraints.tabTitle"), Entradas); // NOI18N

        Saidas.setName("Saidas"); // NOI18N
        Saidas.setOpaque(false);

        jPanel12.setName("jPanel12"); // NOI18N
        jPanel12.setOpaque(false);

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        tabelaSaidas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Id", "Número", "Depósito", "Tipo", "Data Saída", "Situação", "Valor R$"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabelaSaidas.setName("tabelaSaidas"); // NOI18N
        tabelaSaidas.setSelectionBackground(resourceMap.getColor("tabelaSaidas.selectionBackground")); // NOI18N
        tabelaSaidas.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelaSaidasMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(tabelaSaidas);
        tabelaSaidas.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("tabelaSaidas.columnModel.title1")); // NOI18N
        tabelaSaidas.getColumnModel().getColumn(2).setHeaderValue(resourceMap.getString("tabelaSaidas.columnModel.title2")); // NOI18N
        tabelaSaidas.getColumnModel().getColumn(3).setHeaderValue(resourceMap.getString("tabelaSaidas.columnModel.title3")); // NOI18N
        tabelaSaidas.getColumnModel().getColumn(4).setHeaderValue(resourceMap.getString("tabelaSaidas.columnModel.title4")); // NOI18N
        tabelaSaidas.getColumnModel().getColumn(5).setHeaderValue(resourceMap.getString("tabelaSaidas.columnModel.title5")); // NOI18N

        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel11.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), resourceMap.getColor("jPanel11.border.titleColor"))); // NOI18N
        jPanel11.setName("jPanel11"); // NOI18N
        jPanel11.setOpaque(false);

        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
        jLabel15.setName("jLabel15"); // NOI18N

        comboDepositoSaida.setName("comboDepositoSaida"); // NOI18N

        comboTipoSaida.setName("comboTipoSaida"); // NOI18N

        try {
            txtInicioSaida.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        txtInicioSaida.setName("txtInicioSaida"); // NOI18N

        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N

        try {
            txtFimSaida.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        txtFimSaida.setName("txtFimSaida"); // NOI18N

        jLabel20.setText(resourceMap.getString("jLabel20.text")); // NOI18N
        jLabel20.setName("jLabel20"); // NOI18N

        btnFiltrarSaidas.setIcon(resourceMap.getIcon("btnFiltrarSaidas.icon")); // NOI18N
        btnFiltrarSaidas.setText(resourceMap.getString("btnFiltrarSaidas.text")); // NOI18N
        btnFiltrarSaidas.setName("btnFiltrarSaidas"); // NOI18N
        btnFiltrarSaidas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFiltrarSaidasActionPerformed(evt);
            }
        });

        jLabel21.setText(resourceMap.getString("jLabel21.text")); // NOI18N
        jLabel21.setName("jLabel21"); // NOI18N

        comboSitSaida.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Confirmada", "Lançada", "Conf/Lanc", "Cancelada" }));
        comboSitSaida.setName("comboSitSaida"); // NOI18N

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel15)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboDepositoSaida, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(68, 68, 68)
                        .addComponent(comboTipoSaida, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel21)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(comboSitSaida, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel18)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtInicioSaida, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel20)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtFimSaida, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnFiltrarSaidas)))
                .addContainerGap(363, Short.MAX_VALUE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(comboDepositoSaida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(comboTipoSaida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(comboSitSaida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18)
                    .addComponent(txtInicioSaida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20)
                    .addComponent(txtFimSaida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnFiltrarSaidas))
                .addContainerGap())
        );

        jPanel13.setName("jPanel13"); // NOI18N
        jPanel13.setOpaque(false);
        jPanel13.setPreferredSize(new java.awt.Dimension(775, 81));

        jToolBar2.setFloatable(false);
        jToolBar2.setRollover(true);
        jToolBar2.setName("jToolBar2"); // NOI18N
        jToolBar2.setOpaque(false);

        jSeparator5.setName("jSeparator5"); // NOI18N
        jToolBar2.add(jSeparator5);

        btnNovaSaida.setIcon(resourceMap.getIcon("btnNovaSaida.icon")); // NOI18N
        btnNovaSaida.setText(resourceMap.getString("btnNovaSaida.text")); // NOI18N
        btnNovaSaida.setToolTipText(resourceMap.getString("btnNovaSaida.toolTipText")); // NOI18N
        btnNovaSaida.setFocusable(false);
        btnNovaSaida.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnNovaSaida.setName("btnNovaSaida"); // NOI18N
        btnNovaSaida.setOpaque(false);
        btnNovaSaida.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnNovaSaida.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnNovaSaidaActionPerformed(evt);
            }
        });
        jToolBar2.add(btnNovaSaida);

        jSeparator3.setName("jSeparator3"); // NOI18N
        jToolBar2.add(jSeparator3);

        btnImprimirSaida.setIcon(resourceMap.getIcon("btnImprimirSaida.icon")); // NOI18N
        btnImprimirSaida.setText(resourceMap.getString("btnImprimirSaida.text")); // NOI18N
        btnImprimirSaida.setToolTipText(resourceMap.getString("btnImprimirSaida.toolTipText")); // NOI18N
        btnImprimirSaida.setFocusable(false);
        btnImprimirSaida.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnImprimirSaida.setName("btnImprimirSaida"); // NOI18N
        btnImprimirSaida.setOpaque(false);
        btnImprimirSaida.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnImprimirSaida.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnImprimirSaidaActionPerformed(evt);
            }
        });
        jToolBar2.add(btnImprimirSaida);

        jSeparator4.setName("jSeparator4"); // NOI18N
        jToolBar2.add(jSeparator4);

        btnLimparSaida.setIcon(resourceMap.getIcon("btnLimparSaida.icon")); // NOI18N
        btnLimparSaida.setText(resourceMap.getString("btnLimparSaida.text")); // NOI18N
        btnLimparSaida.setToolTipText(resourceMap.getString("btnLimparSaida.toolTipText")); // NOI18N
        btnLimparSaida.setFocusable(false);
        btnLimparSaida.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnLimparSaida.setName("btnLimparSaida"); // NOI18N
        btnLimparSaida.setOpaque(false);
        btnLimparSaida.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar2.add(btnLimparSaida);

        jSeparator6.setName("jSeparator6"); // NOI18N
        jToolBar2.add(jSeparator6);

        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel14.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), resourceMap.getColor("jPanel14.border.titleColor"))); // NOI18N
        jPanel14.setName("jPanel14"); // NOI18N
        jPanel14.setOpaque(false);

        txtLocalizarSaida.setFont(resourceMap.getFont("txtLocalizarSaida.font")); // NOI18N
        txtLocalizarSaida.setName("txtLocalizarSaida"); // NOI18N

        btnLocalizarSaida.setIcon(resourceMap.getIcon("btnLocalizarSaida.icon")); // NOI18N
        btnLocalizarSaida.setName("btnLocalizarSaida"); // NOI18N

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(txtLocalizarSaida, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnLocalizarSaida)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtLocalizarSaida, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnLocalizarSaida, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N
        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        txtTotalSaida.setFont(resourceMap.getFont("txtTotalSaida.font")); // NOI18N
        txtTotalSaida.setText(resourceMap.getString("txtTotalSaida.text")); // NOI18N
        txtTotalSaida.setName("txtTotalSaida"); // NOI18N

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jToolBar2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 364, Short.MAX_VALUE)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtTotalSaida, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtTotalSaida, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE)
                    .addComponent(jPanel14, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jToolBar2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, 878, Short.MAX_VALUE)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 858, Short.MAX_VALUE)
                    .addComponent(jPanel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout SaidasLayout = new javax.swing.GroupLayout(Saidas);
        Saidas.setLayout(SaidasLayout);
        SaidasLayout.setHorizontalGroup(
            SaidasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        SaidasLayout.setVerticalGroup(
            SaidasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab(resourceMap.getString("Saidas.TabConstraints.tabTitle"), Saidas); // NOI18N

        Extratos.setName("Extratos"); // NOI18N
        Extratos.setOpaque(false);

        jPanel18.setName("jPanel18"); // NOI18N
        jPanel18.setOpaque(false);

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        tabelaExtrato.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Data", "Movimentação", "Número", "Depósito", "Saldo Anterior", "Valor Mov", "Saldo Posterior"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabelaExtrato.setName("tabelaExtrato"); // NOI18N
        tabelaExtrato.setOpaque(false);
        tabelaExtrato.setSelectionBackground(resourceMap.getColor("tabelaExtrato.selectionBackground")); // NOI18N
        jScrollPane3.setViewportView(tabelaExtrato);
        tabelaExtrato.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("tabelaSaidas.columnModel.title1")); // NOI18N
        tabelaExtrato.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("tabelaSaidas.columnModel.title2")); // NOI18N
        tabelaExtrato.getColumnModel().getColumn(3).setHeaderValue(resourceMap.getString("tabelaExtrato.columnModel.title0")); // NOI18N
        tabelaExtrato.getColumnModel().getColumn(4).setHeaderValue(resourceMap.getString("tabelaSaidas.columnModel.title3")); // NOI18N
        tabelaExtrato.getColumnModel().getColumn(5).setHeaderValue(resourceMap.getString("tabelaSaidas.columnModel.title4")); // NOI18N
        tabelaExtrato.getColumnModel().getColumn(6).setHeaderValue(resourceMap.getString("tabelaSaidas.columnModel.title5")); // NOI18N

        jPanel19.setName("jPanel19"); // NOI18N
        jPanel19.setOpaque(false);

        jToolBar3.setFloatable(false);
        jToolBar3.setRollover(true);
        jToolBar3.setName("jToolBar3"); // NOI18N
        jToolBar3.setOpaque(false);

        jSeparator9.setName("jSeparator9"); // NOI18N
        jToolBar3.add(jSeparator9);

        btnImprimirExt.setIcon(resourceMap.getIcon("btnImprimirExt.icon")); // NOI18N
        btnImprimirExt.setText(resourceMap.getString("btnImprimirExt.text")); // NOI18N
        btnImprimirExt.setToolTipText(resourceMap.getString("btnImprimirExt.toolTipText")); // NOI18N
        btnImprimirExt.setFocusable(false);
        btnImprimirExt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnImprimirExt.setName("btnImprimirExt"); // NOI18N
        btnImprimirExt.setOpaque(false);
        btnImprimirExt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        btnImprimirExt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnImprimirExtActionPerformed(evt);
            }
        });
        jToolBar3.add(btnImprimirExt);

        jSeparator10.setName("jSeparator10"); // NOI18N
        jToolBar3.add(jSeparator10);

        btnLimparExt.setIcon(resourceMap.getIcon("btnLimparExt.icon")); // NOI18N
        btnLimparExt.setText(resourceMap.getString("btnLimparExt.text")); // NOI18N
        btnLimparExt.setToolTipText(resourceMap.getString("btnLimparExt.toolTipText")); // NOI18N
        btnLimparExt.setFocusable(false);
        btnLimparExt.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        btnLimparExt.setName("btnLimparExt"); // NOI18N
        btnLimparExt.setOpaque(false);
        btnLimparExt.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar3.add(btnLimparExt);

        jSeparator11.setName("jSeparator11"); // NOI18N
        jToolBar3.add(jSeparator11);

        jLabel4.setFont(resourceMap.getFont("jLabel4.font")); // NOI18N
        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N

        txtTotalExt.setFont(resourceMap.getFont("txtTotalExt.font")); // NOI18N
        txtTotalExt.setText(resourceMap.getString("txtTotalExt.text")); // NOI18N
        txtTotalExt.setName("txtTotalExt"); // NOI18N

        jLabel2.setFont(resourceMap.getFont("jLabel2.font")); // NOI18N
        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        txtDepositoExtrato.setText(resourceMap.getString("txtDepositoExtrato.text")); // NOI18N
        txtDepositoExtrato.setName("txtDepositoExtrato"); // NOI18N

        javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
        jPanel19.setLayout(jPanel19Layout);
        jPanel19Layout.setHorizontalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jToolBar3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 231, Short.MAX_VALUE)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtDepositoExtrato, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtTotalExt)
                .addGap(24, 24, 24))
        );
        jPanel19Layout.setVerticalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addGap(14, 14, 14)
                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel19Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jToolBar3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtTotalExt, javax.swing.GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel19Layout.createSequentialGroup()
                .addContainerGap(31, Short.MAX_VALUE)
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE)
                    .addComponent(txtDepositoExtrato, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(29, 29, 29))
        );

        jPanel17.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel17.border.title"))); // NOI18N
        jPanel17.setName("jPanel17"); // NOI18N
        jPanel17.setOpaque(false);

        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N

        comboDepositoExt.setName("comboDepositoExt"); // NOI18N

        try {
            txtInicioExt.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        txtInicioExt.setName("txtInicioExt"); // NOI18N

        jLabel23.setText(resourceMap.getString("jLabel23.text")); // NOI18N
        jLabel23.setName("jLabel23"); // NOI18N

        try {
            txtFimExt.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        txtFimExt.setName("txtFimExt"); // NOI18N

        jLabel24.setText(resourceMap.getString("jLabel24.text")); // NOI18N
        jLabel24.setName("jLabel24"); // NOI18N

        btnFiltrarExt.setText(resourceMap.getString("btnFiltrarExt.text")); // NOI18N
        btnFiltrarExt.setName("btnFiltrarExt"); // NOI18N
        btnFiltrarExt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFiltrarExtActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addComponent(jLabel17)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(comboDepositoExt, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel23)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(txtInicioExt, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel24)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(txtFimExt, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnFiltrarExt, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(295, Short.MAX_VALUE))
        );
        jPanel17Layout.setVerticalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(comboDepositoExt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel23)
                    .addComponent(txtInicioExt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel24)
                    .addComponent(txtFimExt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnFiltrarExt)
                    .addComponent(jLabel17))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
        jPanel18.setLayout(jPanel18Layout);
        jPanel18Layout.setHorizontalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 858, Short.MAX_VALUE)
                    .addComponent(jPanel17, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel18Layout.setVerticalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout ExtratosLayout = new javax.swing.GroupLayout(Extratos);
        Extratos.setLayout(ExtratosLayout);
        ExtratosLayout.setHorizontalGroup(
            ExtratosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        ExtratosLayout.setVerticalGroup(
            ExtratosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab(resourceMap.getString("Extratos.TabConstraints.tabTitle"), Extratos); // NOI18N

        Convenios.setBackground(resourceMap.getColor("Convenios.background")); // NOI18N
        Convenios.setName("Convenios"); // NOI18N

        jPanel7.setBackground(resourceMap.getColor("jPanel7.background")); // NOI18N
        jPanel7.setName("jPanel7"); // NOI18N

        jScrollPane4.setName("jScrollPane4"); // NOI18N

        tabelaConvenio.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Id", "Nome", "Ligação", "Situação", "Comp.", "Ano.", "Pago", "Selecionar"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false, true
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabelaConvenio.setName("tabelaConvenio"); // NOI18N
        tabelaConvenio.setSelectionBackground(resourceMap.getColor("tabelaConvenio.selectionBackground")); // NOI18N
        jScrollPane4.setViewportView(tabelaConvenio);
        tabelaConvenio.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title0")); // NOI18N
        tabelaConvenio.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title1")); // NOI18N
        tabelaConvenio.getColumnModel().getColumn(2).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title2")); // NOI18N
        tabelaConvenio.getColumnModel().getColumn(3).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title6")); // NOI18N
        tabelaConvenio.getColumnModel().getColumn(4).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title3")); // NOI18N
        tabelaConvenio.getColumnModel().getColumn(5).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title4")); // NOI18N
        tabelaConvenio.getColumnModel().getColumn(6).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title5")); // NOI18N

        jPanel2.setBackground(resourceMap.getColor("jPanel2.background")); // NOI18N
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel2.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), resourceMap.getColor("jPanel2.border.titleColor"))); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jPanel4.setBackground(resourceMap.getColor("jPanel4.background")); // NOI18N
        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel4.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), resourceMap.getColor("jPanel4.border.titleColor"))); // NOI18N
        jPanel4.setName("jPanel4"); // NOI18N

        jLabel25.setText(resourceMap.getString("jLabel25.text")); // NOI18N
        jLabel25.setName("jLabel25"); // NOI18N

        comboAnoConv.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2011", "2012", "2013", "2014", "2015", "2016" }));
        comboAnoConv.setName("comboAnoConv"); // NOI18N

        comboCompConv.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" }));
        comboCompConv.setName("comboCompConv"); // NOI18N

        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel14)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(comboCompConv, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel25)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(comboAnoConv, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(51, 51, 51))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(comboCompConv, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel25)
                    .addComponent(comboAnoConv, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        jPanel5.setBackground(resourceMap.getColor("jPanel5.background")); // NOI18N
        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel5.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), resourceMap.getColor("jPanel5.border.titleColor"))); // NOI18N
        jPanel5.setName("jPanel5"); // NOI18N

        radioAdimplentesConv.setBackground(resourceMap.getColor("radioAdimplentesConv.background")); // NOI18N
        radioAdimplentesConv.setSelected(true);
        radioAdimplentesConv.setText(resourceMap.getString("radioAdimplentesConv.text")); // NOI18N
        radioAdimplentesConv.setName("radioAdimplentesConv"); // NOI18N

        radioInadimplentesConv.setBackground(resourceMap.getColor("radioInadimplentesConv.background")); // NOI18N
        radioInadimplentesConv.setText(resourceMap.getString("radioInadimplentesConv.text")); // NOI18N
        radioInadimplentesConv.setName("radioInadimplentesConv"); // NOI18N

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(radioAdimplentesConv)
                    .addComponent(radioInadimplentesConv))
                .addContainerGap(53, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(radioAdimplentesConv)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(radioInadimplentesConv))
        );

        jPanel6.setBackground(resourceMap.getColor("jPanel6.background")); // NOI18N
        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel6.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), resourceMap.getColor("jPanel6.border.titleColor"))); // NOI18N
        jPanel6.setName("jPanel6"); // NOI18N

        comboConvenioConv.setName("comboConvenioConv"); // NOI18N

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(comboConvenioConv, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(17, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(comboConvenioConv, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(15, Short.MAX_VALUE))
        );

        btnFiltraConvenios.setIcon(resourceMap.getIcon("btnFiltraConvenios.icon")); // NOI18N
        btnFiltraConvenios.setText(resourceMap.getString("btnFiltraConvenios.text")); // NOI18N
        btnFiltraConvenios.setName("btnFiltraConvenios"); // NOI18N
        btnFiltraConvenios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFiltraConveniosActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnFiltraConvenios)
                .addContainerGap(47, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(btnFiltraConvenios)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(32, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 858, Short.MAX_VALUE)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 313, Short.MAX_VALUE)
                .addContainerGap())
        );

        javax.swing.GroupLayout ConveniosLayout = new javax.swing.GroupLayout(Convenios);
        Convenios.setLayout(ConveniosLayout);
        ConveniosLayout.setHorizontalGroup(
            ConveniosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        ConveniosLayout.setVerticalGroup(
            ConveniosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab(resourceMap.getString("Convenios.TabConstraints.tabTitle"), Convenios); // NOI18N

        Contribuicoes.setBackground(resourceMap.getColor("Contribuicoes.background")); // NOI18N
        Contribuicoes.setName("Contribuicoes"); // NOI18N

        jPanel23.setBackground(resourceMap.getColor("jPanel23.background")); // NOI18N
        jPanel23.setName("jPanel23"); // NOI18N

        jScrollPane5.setName("jScrollPane5"); // NOI18N

        tabelaContribuicao.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Id", "Nome", "Ligação", "Situação", "Comp.", "Ano.", "Pago"
            }
        ) {
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false
            };

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tabelaContribuicao.setName("tabelaContribuicao"); // NOI18N
        tabelaContribuicao.setSelectionBackground(resourceMap.getColor("tabelaContribuicao.selectionBackground")); // NOI18N
        jScrollPane5.setViewportView(tabelaContribuicao);
        tabelaContribuicao.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title0")); // NOI18N
        tabelaContribuicao.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title1")); // NOI18N
        tabelaContribuicao.getColumnModel().getColumn(2).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title2")); // NOI18N
        tabelaContribuicao.getColumnModel().getColumn(3).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title6")); // NOI18N
        tabelaContribuicao.getColumnModel().getColumn(4).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title3")); // NOI18N
        tabelaContribuicao.getColumnModel().getColumn(5).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title4")); // NOI18N
        tabelaContribuicao.getColumnModel().getColumn(6).setHeaderValue(resourceMap.getString("tabelaConvenio.columnModel.title5")); // NOI18N

        jPanel16.setBackground(resourceMap.getColor("jPanel16.background")); // NOI18N
        jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel16.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), resourceMap.getColor("jPanel16.border.titleColor"))); // NOI18N
        jPanel16.setName("jPanel16"); // NOI18N

        btnFiltrarContribuicoes.setIcon(resourceMap.getIcon("btnFiltrarContribuicoes.icon")); // NOI18N
        btnFiltrarContribuicoes.setText(resourceMap.getString("btnFiltrarContribuicoes.text")); // NOI18N
        btnFiltrarContribuicoes.setToolTipText(resourceMap.getString("btnFiltrarContribuicoes.toolTipText")); // NOI18N
        btnFiltrarContribuicoes.setName("btnFiltrarContribuicoes"); // NOI18N
        btnFiltrarContribuicoes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnFiltrarContribuicoesActionPerformed(evt);
            }
        });

        jPanel21.setBackground(resourceMap.getColor("jPanel21.background")); // NOI18N
        jPanel21.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel21.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 0, 11), resourceMap.getColor("jPanel21.border.titleColor"))); // NOI18N
        jPanel21.setName("jPanel21"); // NOI18N

        radioAdimplentesCont.setBackground(resourceMap.getColor("radioAdimplentesCont.background")); // NOI18N
        radioAdimplentesCont.setSelected(true);
        radioAdimplentesCont.setText(resourceMap.getString("radioAdimplentesCont.text")); // NOI18N
        radioAdimplentesCont.setName("radioAdimplentesCont"); // NOI18N

        radioInadimplentesCont.setBackground(resourceMap.getColor("radioInadimplentesCont.background")); // NOI18N
        radioInadimplentesCont.setText(resourceMap.getString("radioInadimplentesCont.text")); // NOI18N
        radioInadimplentesCont.setName("radioInadimplentesCont"); // NOI18N

        javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21);
        jPanel21.setLayout(jPanel21Layout);
        jPanel21Layout.setHorizontalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel21Layout.createSequentialGroup()
                .addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(radioAdimplentesCont)
                    .addComponent(radioInadimplentesCont))
                .addContainerGap(53, Short.MAX_VALUE))
        );
        jPanel21Layout.setVerticalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel21Layout.createSequentialGroup()
                .addComponent(radioAdimplentesCont)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(radioInadimplentesCont))
        );

        jPanel20.setBackground(resourceMap.getColor("jPanel20.background")); // NOI18N
        jPanel20.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel20.border.title"))); // NOI18N
        jPanel20.setName("jPanel20"); // NOI18N

        comboCompCont1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" }));
        comboCompCont1.setName("comboCompCont1"); // NOI18N

        jLabel28.setText(resourceMap.getString("jLabel28.text")); // NOI18N
        jLabel28.setName("jLabel28"); // NOI18N

        comboAnoCont1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2011", "2012", "2013", "2014", "2015", "2016" }));
        comboAnoCont1.setName("comboAnoCont1"); // NOI18N

        comboAnoCont2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2011", "2012", "2013", "2014", "2015", "2016" }));
        comboAnoCont2.setName("comboAnoCont2"); // NOI18N

        jLabel29.setText(resourceMap.getString("jLabel29.text")); // NOI18N
        jLabel29.setName("jLabel29"); // NOI18N

        comboCompCont2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12" }));
        comboCompCont2.setName("comboCompCont2"); // NOI18N

        jLabel26.setText(resourceMap.getString("jLabel26.text")); // NOI18N
        jLabel26.setName("jLabel26"); // NOI18N

        jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
        jLabel19.setName("jLabel19"); // NOI18N

        javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
        jPanel20.setLayout(jPanel20Layout);
        jPanel20Layout.setHorizontalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel19)
                .addGap(18, 18, 18)
                .addComponent(comboCompCont1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel28)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(comboAnoCont1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(12, 12, 12)
                .addComponent(jLabel26)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(comboCompCont2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel29)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(comboAnoCont2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(38, Short.MAX_VALUE))
        );
        jPanel20Layout.setVerticalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(comboCompCont1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28)
                    .addComponent(comboAnoCont1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel19)
                    .addComponent(comboCompCont2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel29)
                    .addComponent(comboAnoCont2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel26))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnFiltrarContribuicoes)
                .addContainerGap(207, Short.MAX_VALUE))
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(btnFiltrarContribuicoes)
                    .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jPanel20, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel21, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel23Layout = new javax.swing.GroupLayout(jPanel23);
        jPanel23.setLayout(jPanel23Layout);
        jPanel23Layout.setHorizontalGroup(
            jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel23Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 858, Short.MAX_VALUE)
                    .addComponent(jPanel16, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel23Layout.setVerticalGroup(
            jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel23Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 287, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(47, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout ContribuicoesLayout = new javax.swing.GroupLayout(Contribuicoes);
        Contribuicoes.setLayout(ContribuicoesLayout);
        ContribuicoesLayout.setHorizontalGroup(
            ContribuicoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel23, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        ContribuicoesLayout.setVerticalGroup(
            ContribuicoesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ContribuicoesLayout.createSequentialGroup()
                .addComponent(jPanel23, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("Contribuicoes.TabConstraints.tabTitle"), Contribuicoes); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 883, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 501, Short.MAX_VALUE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void comboDepEntActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboDepEntActionPerformed
        try {
            acaoComboDeposito();
        } catch (SQLException ex) {
            Logger.getLogger(TelaFinanceiro.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_comboDepEntActionPerformed

    private void comboTipoEntActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboTipoEntActionPerformed
        try {
            acaoComboTipoEntrada();
        } catch (SQLException ex) {
            Logger.getLogger(TelaFinanceiro.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_comboTipoEntActionPerformed

    private void btnFiltrarEntradasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFiltrarEntradasActionPerformed
        try {
            filtrarEntradas();
        } catch (ParseException ex) {
            Logger.getLogger(TelaFinanceiro.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btnFiltrarEntradasActionPerformed

    private void btnFiltrarSaidasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFiltrarSaidasActionPerformed
        try {
            filtrarSaidas();
        } catch (ParseException ex) {
            Logger.getLogger(TelaFinanceiro.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btnFiltrarSaidasActionPerformed

    private void btnNovaEntradaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovaEntradaActionPerformed
        try {
            abrirIFrame(new TelaFinEntrada());
        } catch (Exception ex) {
            Logger.getLogger(TelaFinanceiro.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btnNovaEntradaActionPerformed

    private void btnNovaSaidaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovaSaidaActionPerformed
        try {
            abrirIFrame(new TelaFinSaida());
        } catch (Exception ex) {
            Logger.getLogger(TelaFinanceiro.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btnNovaSaidaActionPerformed

    private void btnFiltrarExtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFiltrarExtActionPerformed
        try {
            AplicarFiltrosExtrato();
        } catch (ParseException ex) {
            Logger.getLogger(TelaFinanceiro.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btnFiltrarExtActionPerformed

    private void tabelaEntradasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaEntradasMouseClicked
        if (evt.getClickCount() >= 2) {
            try {
                abrirEntrada();
            } catch (SQLException ex) {
                Logger.getLogger(TelaFinanceiro.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_tabelaEntradasMouseClicked

    private void btnFiltraConveniosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFiltraConveniosActionPerformed
        try {
            selecionarFiltroConvenios();
        } catch (ParseException ex) {
            Logger.getLogger(TelaFinanceiro.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btnFiltraConveniosActionPerformed

    private void btnFiltrarContribuicoesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFiltrarContribuicoesActionPerformed
        try {
            selecionarFiltroContribuicoes();
        } catch (ParseException ex) {
            Logger.getLogger(TelaFinanceiro.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_btnFiltrarContribuicoesActionPerformed

    private void btnImprimirEntradaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImprimirEntradaActionPerformed
        imprimirEntradas();
    }//GEN-LAST:event_btnImprimirEntradaActionPerformed

    private void btnImprimirSaidaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImprimirSaidaActionPerformed
        imprimirSaidas();
    }//GEN-LAST:event_btnImprimirSaidaActionPerformed

    private void btnImprimirExtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImprimirExtActionPerformed
        imprimirExtrato();
    }//GEN-LAST:event_btnImprimirExtActionPerformed

    private void tabelaSaidasMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaSaidasMouseClicked
        if (evt.getClickCount() >= 2) {
            try {
                abrirSaida();
            } catch (SQLException ex) {
                Logger.getLogger(TelaFinanceiro.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }//GEN-LAST:event_tabelaSaidasMouseClicked
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel Contribuicoes;
    private javax.swing.JPanel Convenios;
    private javax.swing.JPanel Entradas;
    private javax.swing.JPanel Extratos;
    private javax.swing.JPanel Saidas;
    private javax.swing.JButton btnFiltraConvenios;
    private javax.swing.JButton btnFiltrarContribuicoes;
    private javax.swing.JButton btnFiltrarEntradas;
    private javax.swing.JButton btnFiltrarExt;
    private javax.swing.JButton btnFiltrarSaidas;
    private javax.swing.JButton btnImprimirEntrada;
    private javax.swing.JButton btnImprimirExt;
    private javax.swing.JButton btnImprimirSaida;
    private javax.swing.JButton btnLimparEntrada;
    private javax.swing.JButton btnLimparExt;
    private javax.swing.JButton btnLimparSaida;
    private javax.swing.JButton btnLocalizarEntrada;
    private javax.swing.JButton btnLocalizarSaida;
    private javax.swing.JButton btnNovaEntrada;
    private javax.swing.JButton btnNovaSaida;
    private javax.swing.JComboBox comboAnoCont1;
    private javax.swing.JComboBox comboAnoCont2;
    private javax.swing.JComboBox comboAnoConv;
    private javax.swing.JComboBox comboAnoEnt;
    private javax.swing.JComboBox comboCompCont1;
    private javax.swing.JComboBox comboCompCont2;
    private javax.swing.JComboBox comboCompConv;
    private javax.swing.JComboBox comboComptEnt;
    private javax.swing.JComboBox comboConv;
    private javax.swing.JComboBox comboConvenioConv;
    private javax.swing.JComboBox comboDepEnt;
    private javax.swing.JComboBox comboDepositoExt;
    private javax.swing.JComboBox comboDepositoSaida;
    private javax.swing.JComboBox comboSitEnt;
    private javax.swing.JComboBox comboSitSaida;
    private javax.swing.JComboBox comboTipoEnt;
    private javax.swing.JComboBox comboTipoSaida;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel20;
    private javax.swing.JPanel jPanel21;
    private javax.swing.JPanel jPanel23;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JToolBar.Separator jSeparator1;
    private javax.swing.JToolBar.Separator jSeparator10;
    private javax.swing.JToolBar.Separator jSeparator11;
    private javax.swing.JToolBar.Separator jSeparator2;
    private javax.swing.JToolBar.Separator jSeparator3;
    private javax.swing.JToolBar.Separator jSeparator4;
    private javax.swing.JToolBar.Separator jSeparator5;
    private javax.swing.JToolBar.Separator jSeparator6;
    private javax.swing.JToolBar.Separator jSeparator7;
    private javax.swing.JToolBar.Separator jSeparator8;
    private javax.swing.JToolBar.Separator jSeparator9;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JToolBar jToolBar2;
    private javax.swing.JToolBar jToolBar3;
    private javax.swing.JRadioButton radioAdimplentesCont;
    private javax.swing.JRadioButton radioAdimplentesConv;
    private javax.swing.JRadioButton radioInadimplentesCont;
    private javax.swing.JRadioButton radioInadimplentesConv;
    private javax.swing.JTable tabelaContribuicao;
    private javax.swing.JTable tabelaConvenio;
    private javax.swing.JTable tabelaEntradas;
    private javax.swing.JTable tabelaExtrato;
    private javax.swing.JTable tabelaSaidas;
    private javax.swing.JLabel txtDepositoExtrato;
    private javax.swing.JFormattedTextField txtFimEnt;
    private javax.swing.JFormattedTextField txtFimExt;
    private javax.swing.JFormattedTextField txtFimSaida;
    private javax.swing.JFormattedTextField txtInicioEnt;
    private javax.swing.JFormattedTextField txtInicioExt;
    private javax.swing.JFormattedTextField txtInicioSaida;
    private javax.swing.JTextField txtLocalizarEntrada;
    private javax.swing.JTextField txtLocalizarSaida;
    private javax.swing.JLabel txtTotalEntrada;
    private javax.swing.JLabel txtTotalExt;
    private javax.swing.JLabel txtTotalSaida;
    // End of variables declaration//GEN-END:variables
}
